patch
stringlengths
17
31.2k
y
int64
1
1
oldf
stringlengths
0
2.21M
idx
int64
1
1
id
int64
4.29k
68.4k
msg
stringlengths
8
843
proj
stringclasses
212 values
lang
stringclasses
9 values
@@ -139,10 +139,17 @@ class Populator $dependent_classlikes[$fq_classlike_name_lc] = true; - $this->populateDataFromTraits($storage, $storage_provider, $dependent_classlikes); + foreach ($storage->used_traits as $used_trait_lc => $_) { + $this->populateDataFromTrait($storage, $stor...
1
<?php namespace Psalm\Internal\Codebase; use InvalidArgumentException; use Psalm\Internal\Analyzer\ClassLikeAnalyzer; use Psalm\Internal\MethodIdentifier; use Psalm\Internal\Provider\ClassLikeStorageProvider; use Psalm\Internal\Provider\FileReferenceProvider; use Psalm\Internal\Provider\FileStorageProvider; use Psalm...
1
12,069
was there a reason to not loop over parent classes here?
vimeo-psalm
php
@@ -1,6 +1,8 @@ -import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import Ember from 'ember'; +import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import UserSession from 'hospitalrun/mixins/user-session'; + +const { computed } = Ember; /*...
1
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import Ember from 'ember'; import UserSession from 'hospitalrun/mixins/user-session'; /** * Abstract route for top level modules (eg patients, inventory, users) */ export default Ember.Route.extend(UserSession, AuthenticatedRout...
1
13,056
@billybonks Why move `import Ember from 'ember';` to the top?
HospitalRun-hospitalrun-frontend
js
@@ -1,7 +1,16 @@ class Approval < ActiveRecord::Base - include ThreeStateWorkflow - - workflow_column :status + include WorkflowModel + workflow do + state :pending do + event :make_actionable, transitions_to: :actionable + end + state :actionable do + event :approve, transitions_to: :approved +...
1
class Approval < ActiveRecord::Base include ThreeStateWorkflow workflow_column :status belongs_to :proposal has_one :cart, through: :proposal belongs_to :user has_one :api_token, -> { fresh } has_one :approval_group, through: :cart has_one :user_role, -> { where(approval_group_id: cart.approval_group....
1
13,117
Everything's so simple (a `ThreeStateWorkflow`) until it isn't :smirk:
18F-C2
rb
@@ -57,8 +57,9 @@ class OperationTests(ComparisonTestCase): def test_image_contours(self): img = Image(np.array([[0, 1, 0], [3, 4, 5.], [6, 7, 8]])) op_contours = contours(img, levels=[0.5]) - contour = Contours([[(-0.5, 0.416667, 0.5), (-0.25, 0.5, 0.5)], - [(...
1
import numpy as np from nose.plugins.attrib import attr from holoviews import (HoloMap, NdOverlay, NdLayout, GridSpace, Image, Contours, Polygons, Points, Histogram, Curve, Area) from holoviews.element.comparison import ComparisonTestCase from holoviews.operation.element import (operation, trans...
1
20,555
I don't quite understand where the NaNs come from...
holoviz-holoviews
py
@@ -45,8 +45,8 @@ func LoadTestConfig(addr string, allowMultiConnsPerHost bool) *config.Network { config := config.Config{ NodeType: config.DelegateType, Network: config.Network{ - Host: host, - Port: port, + Host: host, + Port: port, MsgLogsCleaningInterval: 2 ...
1
// Copyright (c) 2018 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
1
12,162
File is not `goimports`-ed
iotexproject-iotex-core
go
@@ -354,6 +354,7 @@ func DefaultConfiguration() *Configuration { config.Go.PleaseGoTool = "//_please:please_go" config.Go.EmbedTool = "//_please:please_go_embed" config.Python.PexTool = "//_please:please_pex" + config.Python.WheelResolverTool = "//_please:wheel_resolver" config.Java.JavacWorker = "//_please:jav...
1
// Utilities for reading the Please config files. package core import ( "crypto/sha1" "fmt" "io" "os" "path" "path/filepath" "reflect" "runtime" "sort" "strconv" "strings" "sync" "time" "github.com/google/shlex" "github.com/peterebden/gcfg" "github.com/thought-machine/go-flags" "github.com/thought-...
1
10,193
I wonder if we should look at moving the Python stuff to a plugin and doing this there rather than adding to core plz at this point?
thought-machine-please
go
@@ -44,8 +44,7 @@ class Syntax(base.BaseCommand): ansible = ansible_playbook.AnsiblePlaybook(self.molecule.config.config[ 'ansible']) ansible.add_cli_arg('syntax-check', True) - ansible.add_cli_arg('inventory-file', 'localhost,') - + ansible.add_cli_arg('inventory_file', 'lo...
1
# Copyright (c) 2015-2016 Cisco Systems # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
1
6,507
This is the actual bug fix. I prob should have broken this out into two PRs.
ansible-community-molecule
py
@@ -235,6 +235,16 @@ namespace Nethermind.Core.Specs /// </summary> bool IsEip3198Enabled { get; } + /// <summary> + /// Difficulty Bomb Delay to Q2/2022 + /// </summary> + bool IsEip3238Enabled { get; } + + /// <summary> + /// Reduction in r...
1
// Copyright (c) 2021 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of ...
1
25,333
I am not sure if we need this, we already have DifficultyBombDelays
NethermindEth-nethermind
.cs
@@ -389,6 +389,9 @@ namespace Nethermind.Blockchain.Synchronization } } } + + delaySource.Dispose(); + linkedSource.Dispose(); }, token); }
1
// Copyright (c) 2018 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of ...
1
22,862
move to finally - I can see at least one return that would omit it, also any exception and so on
NethermindEth-nethermind
.cs
@@ -122,7 +122,9 @@ func NewProtocol( if cfg.Consensus.Scheme != config.RollDPoSScheme { return nil, nil } - if !genesisConfig.EnableGravityChainVoting || electionCommittee == nil || genesisConfig.GravityChainStartHeight == 0 { + + if !genesisConfig.EnableGravityChainVoting || genesisConfig.GravityChainStartHeig...
1
// Copyright (c) 2019 IoTeX Foundation // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use...
1
21,324
remove `genesisConfig.GravityChainStartHeight == 0`
iotexproject-iotex-core
go
@@ -4,6 +4,10 @@ declare(strict_types=1); use Doctrine\Common\Annotations\AnnotationRegistry; +$symfonyDumpFunctionPath = 'vendor/symfony/var-dumper/Resources/functions/dump.php'; + +file_exists(__DIR__ . '/../' . $symfonyDumpFunctionPath) ? require_once __DIR__ . '/../' . $symfonyDumpFunctionPath : require_once _...
1
<?php declare(strict_types=1); use Doctrine\Common\Annotations\AnnotationRegistry; /* @var \Composer\Autoload\ClassLoader $loader */ $loader = file_exists(__DIR__ . '/../vendor/autoload.php') ? require __DIR__ . '/../vendor/autoload.php' : require __DIR__ . '/../../vendor/autoload.php'; AnnotationRegistry::register...
1
21,917
this might kill whole application if `var-dumper` will not be installed. What about two separate file_exists conditions (monorepo/project)?
shopsys-shopsys
php
@@ -163,6 +163,11 @@ var ConfigCommand *cobra.Command = &cobra.Command{ util.Failed("Could not write ddev config file: %v", err) } + _, err = app.CreateSettingsFile() + if err != nil { + util.Failed("Could not write settings file: %w", err) + } + // If a provider is specified, prompt about whether to d...
1
package cmd import ( "fmt" "os" "strings" "path/filepath" "github.com/drud/ddev/pkg/ddevapp" "github.com/drud/ddev/pkg/output" "github.com/drud/ddev/pkg/util" "github.com/spf13/cobra" ) // docrootRelPath is the relative path to the docroot where index.php is var docrootRelPath string // siteName is the nam...
1
12,364
Hrm. Maybe this isn't the correct spot to run this? Because it errors if the app type doesn't support settings. But we want to check that before running it.
drud-ddev
go
@@ -1359,7 +1359,7 @@ def get_terminal_width(): else: return None -def pretty_routes(rtlst, header, sortBy=0): +def pretty_list(rtlst, header, sortBy=0): """Pretty route list, and add header""" _l_header = len(header[0]) _space = " "
1
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ General utility functions. """ from __future__ import absolute_import from __future__ import print_function import o...
1
11,478
Why are you changing this name ?
secdev-scapy
py
@@ -579,6 +579,12 @@ def in_docker(): """ if OVERRIDE_IN_DOCKER: return True + + # check things from Dockerfile + # TODO: is it enough? can we remove all the checks bellow? + if __file__.startswith("/opt/code/localstack/") and os.environ.get("USER") == "localstack": + return True + ...
1
import logging import os import platform import re import socket import subprocess import tempfile import time from typing import Any, Dict, List, Mapping, Tuple import six from boto3 import Session from localstack.constants import ( AWS_REGION_US_EAST_1, DEFAULT_BUCKET_MARKER_LOCAL, DEFAULT_DEVELOP_PORT,...
1
13,992
as we discussed, maybe it would be better to - [ ] set OVERRIDE_IN_DOCKER=1 in the Dockerfile - [ ] replace the if statement with `os.path.exists("/run/.containerenv")` as @dfangl suggested
localstack-localstack
py
@@ -455,6 +455,11 @@ def is_ancestor_name( return False +def is_being_called(node: astroid.node_classes.NodeNG) -> bool: + """return True if node is the function being called in a Call node""" + return isinstance(node.parent, astroid.Call) and node.parent.func is node + + def assign_parent(node: astroid...
1
# Copyright (c) 2006-2007, 2009-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2009 Mads Kiilerich <mads@kiilerich.com> # Copyright (c) 2010 Daniel Harding <dharding@gmail.com> # Copyright (c) 2012-2014 Google, Inc. # Copyright (c) 2012 FELD Boris <lothiraldan@gmail.com> # Copyright (c) 2013-202...
1
15,159
I like this style of doing things better than having super big conditional without explanation. Even though I know this won't be re-used it's nice to have a function if only for clarity.
PyCQA-pylint
py
@@ -22,7 +22,10 @@ module RSpec end def example_group_finished(_notification) - @group_level -= 1 + if @group_level > 0 + @group_level -= 1 + end + @group_level end def example_passed(passed)
1
RSpec::Support.require_rspec_core "formatters/base_text_formatter" RSpec::Support.require_rspec_core "formatters/console_codes" module RSpec module Core module Formatters # @private class DocumentationFormatter < BaseTextFormatter Formatters.register self, :example_group_started, :example_gro...
1
16,635
Our preference here is to either have inline statements e.g. `@group_level -= 1 if @group_level > 0` but stylistically here I think `return @group_level if @group_level == 0` might be nicer. As it stands however our rubocop is picking this up as a fail :(
rspec-rspec-core
rb
@@ -20,6 +20,16 @@ package org.apache.iceberg.spark.actions; import org.apache.iceberg.actions.TestRemoveOrphanFilesAction; +import org.junit.Ignore; public class TestRemoveOrphanFilesAction3 extends TestRemoveOrphanFilesAction { + + /** + * Todo: Its failing for Spark3, so has to fix it in the parent class. +...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
24,647
Spark3 Is supported in OSS Iceberg, Do you mean this particular function is not supported in Spark3? If so I think we should have a more clear reason why
apache-iceberg
java
@@ -399,3 +399,11 @@ def get_partition_set_execution_param_data(recon_repo, partition_set_name, parti return ExternalPartitionExecutionErrorData( serializable_error_info_from_exc_info(sys.exc_info()) ) + + +def get_notebook_data(notebook_path): + check.str_param(notebook_path, "noteboo...
1
"""Workhorse functions for individual API requests.""" import os import sys import pendulum from dagster import check from dagster.core.definitions import ScheduleEvaluationContext from dagster.core.definitions.reconstructable import ( ReconstructablePipeline, ReconstructableRepository, ) from dagster.core.de...
1
14,705
something about the arbitrary file access part here makes me nervous. Can we keep the `if not path.endswith(".ipynb")` check from before here as well? Just imagining a weird attack scenario where somebody somehow uses this to get access to confidental files or something
dagster-io-dagster
py
@@ -51,6 +51,14 @@ module Blacklight deprecation_deprecate :solr_search_params_logic= end + def search_builder_class + Blacklight::Solr::SearchBuilder + end + + def search_builder processor_chain = search_params_logic + search_builder_class.new(processor_chain, self) + end + #...
1
module Blacklight ## # This module contains methods that are specified by SearchHelper.search_params_logic # They transform user parameters into parameters that are sent as a request to Solr when # RequestBuilders#solr_search_params is called. # module RequestBuilders extend ActiveSupport::Concern e...
1
5,710
I wonder if we should push this and the search_params_logic into the blacklight config.
projectblacklight-blacklight
rb
@@ -38,6 +38,7 @@ func TestClient(t *testing.T) { cfg := config.Default cfg.API.Port = testutil.RandomPort() ctx := context.Background() + cfg.Genesis.KamchatkaBlockHeight = 10 mockCtrl := gomock.NewController(t) defer mockCtrl.Finish()
1
package client import ( "context" "fmt" "math/big" "testing" "github.com/golang/mock/gomock" "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" "github.com/iotexproject/go-pkgs/hash" "github.com/iotexproject/iotex-proto/golang/iotextypes" "github....
1
23,677
don't need this line, since it is not tested here?
iotexproject-iotex-core
go
@@ -197,6 +197,7 @@ class EmrConnection(AWSQueryConnection): steps=[], bootstrap_actions=[], instance_groups=None, + ami_version="1.0", additional_info=None): """ Runs a job flow
1
# Copyright (c) 2010 Spotify AB # Copyright (c) 2010-2011 Yelp # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, m...
1
8,010
I wonder if adding this new param in the middle of the param list might screw up some existing code that is depending on the old parameter order. Might be better to add it to the end of the parameter list?
boto-boto
py
@@ -178,7 +178,8 @@ public final class BaselineErrorProne implements Plugin<Project> { errorProneOptions.setEnabled(true); errorProneOptions.setDisableWarningsInGeneratedCode(true); - errorProneOptions.setExcludedPaths(project.getBuildDir().getAbsolutePath() + "/.*"); + errorProneOptio...
1
/* * (c) Copyright 2017 Palantir Technologies Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
1
7,505
I wonder if this absolute path is gonna affect the build-cache relocatability of these compile tasks??
palantir-gradle-baseline
java
@@ -18,10 +18,13 @@ class CommandOperationV2 extends OperationBase { this.readPreference = ReadPreference.resolve(parent, this.options); this.readConcern = resolveReadConcern(parent, this.options); this.writeConcern = resolveWriteConcern(parent, this.options); + this.session = options && options.sessi...
1
'use strict'; const { Aspect, OperationBase } = require('./operation'); const ReadConcern = require('../read_concern'); const WriteConcern = require('../write_concern'); const { maxWireVersion } = require('../utils'); const ReadPreference = require('../read_preference'); const { commandSupportsReadConcern } = require(...
1
17,757
possible bug if `fullResponse` is false
mongodb-node-mongodb-native
js
@@ -19,9 +19,11 @@ """A HintManager to draw hints over links.""" -import math -import functools import collections +import functools +import math +import re +from string import ascii_lowercase from PyQt5.QtCore import (pyqtSignal, pyqtSlot, QObject, QEvent, Qt, QUrl, QTimer)
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
1
14,065
nitpick: Please only `import string` here and use `string.ascii_lowercase` - I really like to see what module stuff is coming from without looking at the imports.
qutebrowser-qutebrowser
py
@@ -2822,10 +2822,10 @@ exports.shouldCorrectlyLogoutFromTheDatabaseWithPromises = { db.close(); test.done(); - }).catch(function(err) { }) - }).catch(function(err) { }) - }).catch(function(err) { }) - }).catch(function(err) { }) + }).catch(...
1
"use strict"; var f = require('util').format; /************************************************************************** * * COLLECTION TESTS * *************************************************************************/ /** * Call toArray on an aggregation cursor using a Promise * * @example-class Collection ...
1
13,828
nitpick: the only reason we have a catch for every one of these promises is because the test isn't properly chaining promises (returning them within each `then`). We could reduce the `catch` with `console.dir` to a single instance if that was done
mongodb-node-mongodb-native
js
@@ -85,6 +85,8 @@ TEST(NebulaCodec, encode) { // check empty values std::vector<boost::any> emptyV; std::string emptyEncoded = codec.encode(emptyV); + + SchemaWriter emptyWriter; auto emptySchema = std::make_shared<ResultSchemaProvider>(emptyWriter.moveSchema()); auto emptyReader = RowRead...
1
/* Copyright (c) 2018 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. */ #include <map> #include "base/Base.h" #include <gtest/gtest.h> #include "dataman/RowReader.h" #include "dataman/SchemaW...
1
20,117
why do this?
vesoft-inc-nebula
cpp
@@ -17,7 +17,7 @@ class MediaLibrary extends SystemMediaLibrary */ protected function init() { - traceLog('Class Cms\Classes\MediaLibrary has been deprecated, use System\Classes\MediaLibrary instead.'); + traceLog('Class Cms\Classes\MediaLibrary has been deprecated, use ' . SystemMediaLibr...
1
<?php namespace Cms\Classes; use System\Classes\MediaLibrary as SystemMediaLibrary; /** * Provides abstraction level for the Media Library operations. * Implements the library caching features and security checks. * * @package october\cms * @author Alexey Bobkov, Samuel Georges * @deprecated Use System\Classes\...
1
12,999
For consistency, would it not be best to also replace the first class name? `traceLog('Class ' . static::class . ' has been deprecated, use ' . SystemMediaLibrary::class . ' instead.')`
octobercms-october
php
@@ -123,6 +123,9 @@ type PrometheusSpec struct { // The labels to add to any time series or alerts when communicating with // external systems (federation, remote storage, Alertmanager). ExternalLabels map[string]string `json:"externalLabels,omitempty"` + // Enable access to prometheus web admin API. Defaults to ...
1
// Copyright 2018 The prometheus-operator Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
1
12,166
this should be `EnabledAdminAPI` and the json string should then be `enableAdminAPI`
prometheus-operator-prometheus-operator
go
@@ -4,6 +4,8 @@ from listenbrainz import webserver from werkzeug.serving import run_simple import os import click +import sqlalchemy +from time import sleep from listenbrainz.utils import safely_import_config safely_import_config()
1
from listenbrainz import db from listenbrainz.db import timescale as ts from listenbrainz import webserver from werkzeug.serving import run_simple import os import click from listenbrainz.utils import safely_import_config safely_import_config() @click.group() def cli(): pass ADMIN_SQL_DIR = os.path.join(os.path...
1
18,099
Noticed some missing imports in manage.py so thought I'd add them
metabrainz-listenbrainz-server
py
@@ -301,15 +301,10 @@ func (exp *flowExporter) sendFlowRecords() error { exp.numDataSetsSent = exp.numDataSetsSent + 1 if flowexporter.IsConnectionDying(&record.Conn) { - // If the connection is in dying state or connection is not in conntrack table, - // we will delete the flow records from records map...
1
// Copyright 2020 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
1
40,882
as a future improvement, maybe we should just change `ForAllFlowRecordsDo` so that `updateOrSendFlowRecord` uses a flow record pointer instead of a copy of stored flow record. This whole code is executed with the lock any way.
antrea-io-antrea
go
@@ -37,6 +37,7 @@ import java.util.function.Consumer; * A literal string. * <br/><code>"Hello World!"</code> * <br/><code>"\"\n"</code> + * <br/><code>"\u2122"</code> * <br/><code>"™"</code> * <br/><code>"💩"</code> *
1
/* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. * Copyright (C) 2011, 2013-2016 The JavaParser Team. * * This file is part of JavaParser. * * JavaParser can be used either under the terms of * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the ...
1
11,854
I am not sure what GitHub wants to tell me with this icon here :)
javaparser-javaparser
java
@@ -385,8 +385,8 @@ BOOST_AUTO_TEST_CASE(valid_nearest_urls) BOOST_AUTO_TEST_CASE(valid_tile_urls) { - TileParameters reference_1{1, 2, 3}; - auto result_1 = parseParameters<TileParameters>("tile(1,2,3).mvt"); + TileParameters reference_1{1, 2, 12}; + auto result_1 = parseParameters<TileParameters>("til...
1
#include "server/api/parameters_parser.hpp" #include "parameters_io.hpp" #include "engine/api/base_parameters.hpp" #include "engine/api/match_parameters.hpp" #include "engine/api/nearest_parameters.hpp" #include "engine/api/route_parameters.hpp" #include "engine/api/table_parameters.hpp" #include "engine/api/tile_par...
1
17,999
can we also check for smaller zoom levels returning valid error codes?
Project-OSRM-osrm-backend
cpp
@@ -15,6 +15,16 @@ namespace ScenarioMeasurement Console.WriteLine(message); } + public void LogHeader1(string message) + { + Console.WriteLine($"=============== {message} ================ "); + } + + public void LogHeader2(string message) + { + ...
1
using System; using System.Collections.Generic; using System.Text; namespace ScenarioMeasurement { public class Logger { public Logger(string fileName) { } public void Log(string message) { Console.WriteLine(message); } public void LogVerbo...
1
10,978
1) These names are not great, doesn't help explain what they do. 2) Instead of methods like this that hard code some number of = and *, why not a method that takes the string, defaults to a char to surround with, and a width? 3) Do we really even need headers like this in the output? Maybe we ditch them.
dotnet-performance
.cs
@@ -2943,7 +2943,7 @@ describe('AutocompleteEditor', () => { keyDownUp('arrow_up'); - expect(hot.getActiveEditor().htEditor.getSelected()).toEqual([[0, 0, 0, 0]]); + expect(hot.getActiveEditor().htEditor.getSelected()).toEqual([[11, 0, 11, 0]]); done(); }, 200); });
1
describe('AutocompleteEditor', () => { var id = 'testContainer'; var choices = ['yellow', 'red', 'orange', 'green', 'blue', 'gray', 'black', 'white', 'purple', 'lime', 'olive', 'cyan']; var hot; beforeEach(function() { this.$container = $(`<div id="${id}" style="width: 300px; height: 200px; overflow: aut...
1
14,825
The autocomplete editor shouldn't change its own behavior, I assume that `autoWrapCol` and `autoWrapRow` options should be set to `false` in handsontable editor.
handsontable-handsontable
js
@@ -266,7 +266,7 @@ func testInstallTunnelFlows(t *testing.T, config *testConfig) { } func testInstallServiceFlows(t *testing.T, config *testConfig) { - err := c.InstallClusterServiceFlows() + err := c.InstallClusterServiceFlows(true, true) if err != nil { t.Fatalf("Failed to install Openflow entries to skip s...
1
// Copyright 2019 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
1
22,926
out of curiosity, with IPv6 introduced, why there's no change to the expected output of openflow in the test?
antrea-io-antrea
go
@@ -67,7 +67,10 @@ byte * decode_eflags_usage(dcontext_t *dcontext, byte *pc, uint *usage, dr_opnd_query_flags_t flags) { - *usage = 0; /* FIXME i#1569 */ + /* As long as precise flag information is not provided we conservatively + * assume each instructions may read or write all flags....
1
/* ********************************************************** * Copyright (c) 2016 ARM Limited. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condit...
1
10,873
nit: grammar: instruction
DynamoRIO-dynamorio
c
@@ -19,6 +19,7 @@ package org.openqa.selenium.grid.graphql; import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; + import org.openqa.selenium.grid.distributor.Distributor; import org.openqa.selenium.internal.Require;
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
17,791
We can revert this to reduce the diff of the PR.
SeleniumHQ-selenium
py
@@ -69,7 +69,12 @@ func Add(mgr manager.Manager) error { // newReconciler returns a new reconcile.Reconciler func newReconciler(mgr manager.Manager) reconcile.Reconciler { - return &ReconcileHiveConfig{Client: mgr.GetClient(), scheme: mgr.GetScheme(), restConfig: mgr.GetConfig(), mgr: mgr} + return &ReconcileHiveCo...
1
package hive import ( "context" "crypto/md5" "encoding/hex" "fmt" "os" "reflect" "time" log "github.com/sirupsen/logrus" hivev1 "github.com/openshift/hive/apis/hive/v1" "github.com/openshift/hive/pkg/resource" "github.com/openshift/library-go/pkg/operator/events" apiextclientv1beta1 "k8s.io/apiextensio...
1
17,422
i think this missed the reconciler to callsite change
openshift-hive
go
@@ -990,6 +990,10 @@ public class SurfaceNamer extends NameFormatterDelegator { return getNotImplementedString("SurfaceNamer.getGrpcClientImportName"); } + public String getClientConfigImportModule(Interface service) { + return getNotImplementedString("SurfaceNamer.getClientConfigImportModule"); + } + ...
1
/* Copyright 2016 Google Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
1
21,630
Please reuse `getClientConfigPath`.
googleapis-gapic-generator
java
@@ -19,7 +19,7 @@ const { eachAsyncSeries, ns } = require('../../../src/utils'); const chai = require('chai'); chai.use(require('chai-subset')); -chai.use(require('../../functional/spec-runner/matcher').default); +chai.use(require('../../tools/spec-runner/matcher').default); const expect = chai.expect;
1
'use strict'; const fs = require('fs'); const path = require('path'); const { Topology } = require('../../../src/sdam/topology'); const { TopologyType } = require('../../../src/sdam/common'); const { Server } = require('../../../src/sdam/server'); const { ServerDescription } = require('../../../src/sdam/server_descript...
1
21,923
Should we use the shared chai-addon.js file here? Actually we should consolidate any `chai.use` calls, I see 20 instances, quick win?
mongodb-node-mongodb-native
js
@@ -109,7 +109,7 @@ namespace Nethermind.Network.P2P.ProtocolHandlers HandleHello(Deserialize<HelloMessage>(msg.Data)); foreach (Capability capability in - _agreedCapabilities.GroupBy(c => c.ProtocolCode).Select(c => c.OrderBy(v => v...
1
// Copyright (c) 2021 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of...
1
26,501
Maybe move _agreedCapabilities and _availableCapabilities from List to SortedSet ? We could order them by code and then by version already.
NethermindEth-nethermind
.cs
@@ -3031,11 +3031,9 @@ func (o *consumer) setInitialPendingAndStart() { // Here we are filtered. dp := o.cfg.DeliverPolicy if dp == DeliverLastPerSubject && o.hasSkipListPending() && o.sseq < o.lss.resume { - if o.lss != nil { - ss := mset.store.FilteredState(o.lss.resume, o.cfg.FilterSubject) - o.sseq...
1
// Copyright 2019-2021 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
1
13,811
I see the `+1` issue, but we used to check if `o.lss != nil` and we don't anymore, so we are sure that it won't be nil here, right?
nats-io-nats-server
go
@@ -8,6 +8,11 @@ <% @documents&.each do |document| %> <h1 class="modal-title"><%= document_heading(document) %></h1> + <% if document.respond_to?(:export_as_preferred_citation_txt) %> + <h2><%= t('blacklight.citation.preferred') %></h2> + <%= document.send(:export_as_preferred_citation_txt).html_...
1
<div class="modal-header"> <h1><%= t('blacklight.tools.citation') %></h1> <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <% @documents&.each do ...
1
8,749
why is the `send` needed?
projectblacklight-blacklight
rb
@@ -106,8 +106,9 @@ def bbox2result(bboxes, labels, num_classes): if bboxes.shape[0] == 0: return [np.zeros((0, 5), dtype=np.float32) for i in range(num_classes)] else: - bboxes = bboxes.cpu().numpy() - labels = labels.cpu().numpy() + if isinstance(bboxes, torch.Tensor): + ...
1
import numpy as np import torch def bbox_flip(bboxes, img_shape, direction='horizontal'): """Flip bboxes horizontally or vertically. Args: bboxes (Tensor): Shape (..., 4*k) img_shape (tuple): Image shape. direction (str): Flip direction, options are "horizontal" and "verti...
1
20,197
Is this necessary? If so, we need to update the docstring.
open-mmlab-mmdetection
py
@@ -116,8 +116,8 @@ module Ncr # the highest approver on the stack, pending preferred if status indicates def current_approver_email_address - if self.individual_approvals.pending.first - self.individual_approvals.pending.first.user.email_address + if self.pending? + self.individual_...
1
require 'csv' module Ncr # Make sure all table names use 'ncr_XXX' def self.table_name_prefix 'ncr_' end EXPENSE_TYPES = %w(BA60 BA61 BA80) BUILDING_NUMBERS = YAML.load_file("#{Rails.root}/config/data/ncr/building_numbers.yml") class WorkOrder < ActiveRecord::Base # must define before include Pur...
1
14,426
Checking for actionable here instead of grabbing the first pending approval. I tested this with proposal ID 265 on staging.
18F-C2
rb
@@ -100,7 +100,10 @@ class CallbackChecker(QObject): if self._result is self.UNSET: with self._qtbot.waitSignal(self.got_result, timeout=2000): pass - assert self._result == expected + self._assert_result(self._result, expected) + + def _assert_result(self, result...
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
1
19,621
I made this change because I wasn't getting printouts of the 'result' value when the assert was inlined for some reason. I think it's related to creating new CallbackCheckers maybe?
qutebrowser-qutebrowser
py
@@ -0,0 +1,11 @@ +using System.IO.Pipelines; + +namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +{ + public interface IHttpParser + { + bool ParseStartLine<T>(T handler, ReadableBuffer buffer, out ReadCursor consumed, out ReadCursor examined) where T : IHttpStartLineHandler; + + bool Par...
1
1
11,699
nit: the correct name is "request line", so let's use the right one here :)
aspnet-KestrelHttpServer
.cs
@@ -8,9 +8,12 @@ import os SQLALCHEMY_DATABASE_URI = os.environ['SQLALCHEMY_DATABASE_URI'] REGISTRY_URL = os.environ['REGISTRY_URL'] -CATALOG_HOST = os.environ['CATALOG_HOST'] -CATALOG_URL = 'https://%s' % CATALOG_HOST +CATALOG_URL = os.environ.get('CATALOG_URL') +if not CATALOG_URL.startswith("https"): + prin...
1
# Copyright (c) 2017 Quilt Data, Inc. All rights reserved. """ Config file for prod/stage. Overrides values in config.py. """ import os SQLALCHEMY_DATABASE_URI = os.environ['SQLALCHEMY_DATABASE_URI'] REGISTRY_URL = os.environ['REGISTRY_URL'] CATALOG_HOST = os.environ['CATALOG_HOST'] CATALOG_URL = 'https://%s' % CAT...
1
16,875
This should now use `[]`, so it crashes if the var is missing
quiltdata-quilt
py
@@ -162,6 +162,19 @@ static CALI_BPF_INLINE int skb_nat_l4_csum_ipv4(struct __sk_buff *skb, size_t of return ret; } +static CALI_BPF_INLINE int update_state_map(struct cali_tc_state *state) +{ + int key = 0; + struct cali_tc_state *map_state = cali_v4_state_lookup_elem(&key); + if (!map_state) { + // Shouldn't be...
1
// Project Calico BPF dataplane programs. // Copyright (c) 2020 Tigera, Inc. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at...
1
18,064
you could use `bpf_map_update_elem` with `BPF_EXIST`
projectcalico-felix
c
@@ -57,7 +57,7 @@ public class S3OutputFile extends BaseS3File implements OutputFile { try { return new S3OutputStream(client(), uri(), awsProperties()); } catch (IOException e) { - throw new UncheckedIOException("Filed to create output stream for location: " + uri(), e); + throw new Unchecke...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
33,604
thanks for noticing this! But I think we should not have it in this PR.
apache-iceberg
java
@@ -414,6 +414,11 @@ Transaction.prototype.lockUntilDate = function(time) { if (_.isDate(time)) { time = time.getTime() / 1000; } + + for (var i = 0; i < this.inputs.length; i++) { + this.inputs[i].sequence = Input.DEFAULT_LOCKTIME_SEQNUMBER; + } + this.nLockTime = time; return this; };
1
'use strict'; var _ = require('lodash'); var $ = require('../util/preconditions'); var buffer = require('buffer'); var errors = require('../errors'); var BufferUtil = require('../util/buffer'); var JSUtil = require('../util/js'); var BufferReader = require('../encoding/bufferreader'); var BufferWriter = require('../e...
1
14,509
A few things: - This may not serialize because I think the property for the sequence number on an input is `.sequenceNumber`. - There should be tests to cover these statements - Indentation is incorrect (should be two spaces, as similar to the statements above)
bitpay-bitcore
js
@@ -89,3 +89,16 @@ class BaseNotification(object): output_filename = filename_template.format( self.resource, self.cycle_timestamp, output_timestamp) return output_filename + + @classmethod + def check_data_format(cls, data_format): + """Raise `InvalidDataFormatError` unless ...
1
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
1
29,972
If this is a base method that could be used by others, should you hardcode 'GCS uploader' here?
forseti-security-forseti-security
py
@@ -386,6 +386,18 @@ public final class CharSeq implements CharSequence, IndexedSeq<Character>, Seria return result; } + @Override + public CharSeq padTo(int length, Character element) { + if(length <= back.length()) { + return this; + } + final StringBuilder sb = n...
1
/* / \____ _ ______ _____ / \____ ____ _____ * / \__ \/ \ / \__ \ / __// \__ \ / \/ __ \ Javaslang * _/ // _\ \ \/ / _\ \\_ \/ // _\ \ /\ \__/ / Copyright 2014-2015 Daniel Dietrich * /___/ \_____/\____/\_____/____/\___\_____/_/ \_/____/ Licensed under the Apache License...
1
6,329
just a little thing: let's introduce a `final int bound = length - back.length();` that saves us calculating the bound each time checking the loop condition.
vavr-io-vavr
java
@@ -87,6 +87,16 @@ func (s *server) setupRouting() { "GET": http.HandlerFunc(s.peerBalanceHandler), }) + router.Handle("/settlements", jsonhttp.MethodHandler{ + "GET": http.HandlerFunc(s.settlementsHandler), + }) + router.Handle("/settlements/{peer}", jsonhttp.MethodHandler{ + "GET": http.HandlerFunc(s.peerSet...
1
// Copyright 2020 The Swarm Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package debugapi import ( "expvar" "net/http" "net/http/pprof" "github.com/ethersphere/bee/pkg/jsonhttp" "github.com/ethersphere/bee/pkg/logging" "gi...
1
12,016
I think that this should be a POST method, as it changes the state. Get requests should not change the state. With different method, I would suggest to have the handler under `"/settlements/{peer}"` path.
ethersphere-bee
go
@@ -31,6 +31,7 @@ var errShortRemoteTip = errors.New("Unexpected remote less than tip") // L2GasPrice slot refers to the storage slot that the execution price is stored // in the L2 predeploy contract, the GasPriceOracle var l2GasPriceSlot = common.BigToHash(big.NewInt(1)) +var l2GasPriceOracleAddress = common.HexTo...
1
package rollup import ( "context" "errors" "fmt" "math/big" "strconv" "sync" "sync/atomic" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" "...
1
17,824
This is the default value?
ethereum-optimism-optimism
go
@@ -1,8 +1,8 @@ import os import codecs - +from time import strftime from cliquet import utils as cliquet_utils - +from kinto import __version__ from kinto import logger HERE = os.path.abspath(os.path.dirname(__file__))
1
import os import codecs from cliquet import utils as cliquet_utils from kinto import logger HERE = os.path.abspath(os.path.dirname(__file__)) def render_template(template, destination, **kwargs): template = os.path.join(HERE, template) folder = os.path.dirname(destination) if folder and not os.path.ex...
1
8,914
The spaces are actually legitimate here: in python, you: - first import standard library modules (hint: time is one) - then import 3rd party library modules - then import the modules from you project (here kinto). Between each block you need an empty line.
Kinto-kinto
py
@@ -571,7 +571,7 @@ func (pi *PackageInfo) MarkedSource(obj types.Object) *cpb.MarkedSource { // the object has its own non-blank name, that is used; otherwise if the object // is of a named type, that type's name is used. Otherwise the result is "_". func objectName(obj types.Object) string { - if name := obj.Name(...
1
/* * Copyright 2015 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
1
8,345
Haha, whoa, I'm not sure how I let that one go by. :)
kythe-kythe
go
@@ -577,6 +577,7 @@ public class DownloadInstanceWriter implements MessageBodyWriter<DownloadInstanc } } + // TODO: Return ".md" for "text/markdown" as well as other extensions in MimeTypeDetectionByFileExtension.properties private String getFileExtension(AuxiliaryFile auxFile) { St...
1
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package edu.harvard.iq.dataverse.api; import edu.harvard.iq.dataverse.AuxiliaryFile; import java.lang.reflect.Type; import java.lang.a...
1
45,579
FWIW: We have FileUtil.generateOriginalExtension for tabular files but it uses a hardcoded list rather than the properties file.
IQSS-dataverse
java
@@ -297,6 +297,9 @@ func StartDataplaneDriver(configParams *config.Config, InterfaceName: configParams.WireguardInterfaceName, MTU: configParams.WireguardMTU, RouteSource: configParams.RouteSource, + // currently, AKS *must* encrypt hostnetwork traffic, while it is option...
1
// Copyright (c) 2020-2021 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ...
1
19,213
I would consider extracting this logic in to a helper function to make it a bit more readable, but that's just my opinion.
projectcalico-felix
c
@@ -252,6 +252,7 @@ type Config struct { DebugSimulateCalcGraphHangAfter time.Duration `config:"seconds;0"` DebugSimulateDataplaneHangAfter time.Duration `config:"seconds;0"` DebugPanicAfter time.Duration `config:"seconds;0"` + DebugSimulateDataRace bool `config:"bool;false"` ...
1
// Copyright (c) 2020 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
1
18,007
Are all fields beginning with "Debug" automatically `;local` ? (I guess so, but just checking.)
projectcalico-felix
go
@@ -54,6 +54,10 @@ class EvalHook(Hook): save_best=None, rule=None, **eval_kwargs): + warnings.warn( + 'DeprecationWarning: EvalHook and DistEvalHook is a deprecated, ' + 'please use "mmcv.runner.EvalHook" or "mmcv.runner.DistEvalHook" '...
1
import os.path as osp import warnings from math import inf import mmcv import torch.distributed as dist from mmcv.runner import Hook from torch.nn.modules.batchnorm import _BatchNorm from torch.utils.data import DataLoader from mmdet.utils import get_root_logger class EvalHook(Hook): """Evaluation hook. No...
1
23,045
We should let this module inherits from the EvalHook supported in MMCV, and only override the `__init__` function by adding the warnings. The other functions can use those in MMCV.
open-mmlab-mmdetection
py
@@ -267,14 +267,15 @@ public class PostgreExecutionContext extends JDBCExecutionContext implements DBC } } - void setSessionRole(final DBRProgressMonitor monitor) throws DBCException { + private void setSessionRole(@NotNull DBRProgressMonitor monitor) throws DBCException { final String ro...
1
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2021 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICE...
1
11,169
Let's use prepared statements here instead
dbeaver-dbeaver
java
@@ -2,7 +2,11 @@ * External dependencies */ import { storiesOf } from '@storybook/react'; -import Button from 'GoogleComponents/button'; + +/** + * Internal dependencies + */ +import Button from '../assets/js/components/button'; storiesOf( 'Global', module ) .add( 'Buttons', () => {
1
/** * External dependencies */ import { storiesOf } from '@storybook/react'; import Button from 'GoogleComponents/button'; storiesOf( 'Global', module ) .add( 'Buttons', () => { return ( <div> <p> <Button> Default Button </Button> </p> <p> <Button className="googlesitekit-butto...
1
27,277
Just leaving this in one place but thanks so much for re-organising all these imports.
google-site-kit-wp
js
@@ -43,6 +43,7 @@ #endif /* List of instrumentation functions. */ +#ifdef X86 #define FUNCTIONS() \ FUNCTION(empty) \ FUNCTION(empty_1arg) \
1
/* ******************************************************************************* * Copyright (c) 2017 ARM Limited. All rights reserved. * Copyright (c) 2011 Massachusetts Institute of Technology All rights reserved. * *******************************************************************************/ /* * Redistri...
1
11,936
Ditto, here and below
DynamoRIO-dynamorio
c
@@ -61,7 +61,7 @@ export function initDebug() { } for (const key in vnode.props) { - if (key[0]==='o' && key[1]==='n' && typeof vnode.props[key]!=='function' && vnode.props[key]!=null) { + if (key[0]==='o' && key[1]==='n' && typeof vnode.props[key]!=='function' && vnode.props[key]!=null && typeof vnode.type...
1
import { checkPropTypes } from './check-props'; import { getDisplayName } from './devtools/custom'; import { options, toChildArray } from 'preact'; import { ELEMENT_NODE, DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE } from './constants'; export function initDebug() { /* eslint-disable no-console */ let oldBeforeDiff = opti...
1
13,101
Let's move the check outside the `for`-loop so that we don't have to do it for every prop. If we change it to check for `vnode.type === 'string'` we can automatically skip checking text nodes which don't have props
preactjs-preact
js
@@ -19,6 +19,17 @@ class TablePlot(BokehPlot, GenericElementPlot): height = param.Number(default=None) + finalize_hooks = param.HookList(default=[], doc=""" + Optional list of hooks called when finalizing a column + (deprecated in favor of hooks). The hook is passed the plot + object an...
1
import param from bokeh.models import Column from bokeh.models.widgets import ( DataTable, TableColumn, NumberEditor, NumberFormatter, DateFormatter, DateEditor, StringFormatter, StringEditor, IntEditor ) from ...core import Dataset, Dimension from ...element import ItemTable from ...streams import Buffer fro...
1
21,838
Seems like the docstring here should simply be "Deprecated; use `hooks` instead.".
holoviz-holoviews
py
@@ -62,6 +62,8 @@ public class FeedItemlistAdapter extends BaseAdapter { if(UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) { playingBackGroundColor = ContextCompat.getColor(context, R.color.highlight_dark); + } else if(UserPreferences.getTheme() == R.style.Theme_AntennaPod_T...
1
package de.danoeh.antennapod.adapter; import android.content.Context; import android.content.res.TypedArray; import android.os.Build; import android.support.v4.content.ContextCompat; import android.text.Layout; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; impo...
1
13,685
It would be nice to have an `attr` in `styles.xml` for this, so we don't need the same `if` statement in multiple places
AntennaPod-AntennaPod
java
@@ -0,0 +1,10 @@ +class CreateTeachersJoinTable < ActiveRecord::Migration + def change + create_table :teachers do |t| + t.belongs_to :user + t.belongs_to :workshop + end + + add_index :teachers, [:user_id, :workshop_id], unique: true + end +end
1
1
9,049
How about `null: false` on these two lines? Also `t.timestamps null: false`?
thoughtbot-upcase
rb
@@ -183,6 +183,12 @@ public class HiveTableOperations extends BaseMetastoreTableOperations { } threw = false; } catch (TException | UnknownHostException e) { + if (e.getMessage().contains("Table/View 'HIVE_LOCKS' does not exist")) { + LOG.error("Failed to acquire locks from metastore beca...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
15,336
This recommendation isn't very helpful because it isn't clear what "the metastore" is. How about this instead: "To fix this, use an alternative metastore".
apache-iceberg
java
@@ -87,6 +87,11 @@ public class SymbolTable { return desiredName + suffix; } + /** Returns true if a {@code symbol} is already used. */ + public boolean isSymbolUsed(Name symbol) { + return symbolTable.contains(symbol.toLowerUnderscore()); + } + /** * Returns the next numeric suffix that makes de...
1
/* Copyright 2016 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
1
27,491
The `SymbolTable` deals only with symbols, I think we can just call this `isUsed` here.
googleapis-gapic-generator
java
@@ -165,7 +165,9 @@ webdriver.Builder.prototype.build = function() { } else { var url = this.serverUrl_; var client; - if (url[0] == '/') { + if (webdriver.http.CorsClient.isAvailable()) { + client = new webdriver.http.XhrClient(url); + } else if (url[0] == '/') { var origin = window.l...
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
11,962
Please hide this behind a flag and add a setter function to the builder.
SeleniumHQ-selenium
js
@@ -339,6 +339,9 @@ class EC2VPC(GenericBaseModel): ) for rt in resp["RouteTables"]: for assoc in rt.get("Associations", []): + # skipping Main association (accommodating recent upstream change) + if assoc.get("Main"): ...
1
from moto.ec2.utils import generate_route_id from localstack.services.cloudformation.deployment_utils import generate_default_name from localstack.services.cloudformation.service_models import REF_ID_ATTRS, GenericBaseModel from localstack.utils.aws import aws_stack class EC2RouteTable(GenericBaseModel): @static...
1
14,229
Just a side-node, no need to change it here: The term "recent" might be confusing at a later point in time.
localstack-localstack
py
@@ -36,7 +36,9 @@ module.exports = { this.assertEqual(val1 && val1.getTime(), val2.getTime(), errorMessage, depth + 1); } else if (type === 'object') { - for (const key of Object.keys(val1)) { + var keys = val1.keys !== undefined ? val1.keys() : Object.keys(val1); + ...
1
//////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/li...
1
18,319
When can it be undefined? Wouldn't that be a bug?
realm-realm-js
js
@@ -19,6 +19,8 @@ package org.openqa.grid.internal; import com.google.common.base.Predicate; +import com.sun.org.glassfish.gmbal.ManagedObject; + import net.jcip.annotations.ThreadSafe; import org.openqa.grid.internal.listeners.Prioritizer;
1
/* Copyright 2011 Selenium committers Copyright 2011 Software Freedom Conservancy Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
1
11,529
JMX offers normal APIs for this. I don't think you want the glassfish one.
SeleniumHQ-selenium
py
@@ -430,7 +430,7 @@ class KoalasBoxPlot(BoxPlot): ).alias("{}_{}%".format(colname, int(q * 100))) for q in [0.25, 0.50, 0.75] ], - F.mean(colname).alias("{}_mean".format(colname)) + F.mean(colname).alias("{}_mean".format(colname)), ).toPandas...
1
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
1
15,718
Could you remove `,' at the end?
databricks-koalas
py
@@ -52,6 +52,8 @@ var Server = function(requestHandler) { * with the server host when it has fully started. */ this.start = function(opt_port) { + assert(typeof opt_port !== 'function', + "start invoked with function, not port (mocha callback)?"); var port = opt_port || portprober.findF...
1
// Copyright 2013 Selenium committers // Copyright 2013 Software Freedom Conservancy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 /...
1
11,552
Maybe it would simpler to ignore opt_port if type !== 'number'?
SeleniumHQ-selenium
java
@@ -137,11 +137,11 @@ type AccountData struct { // is expected to have copy-by-value semantics. Assets map[AssetIndex]AssetHolding `codec:"asset,allocbound=-"` - // SpendingKey is the address against which signatures/multisigs/logicsigs should be checked. + // EffectiveAddr is the address against which signatures...
1
// Copyright (C) 2019-2020 Algorand, Inc. // This file is part of go-algorand // // go-algorand is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) ...
1
38,746
do you want to rename the codec tag here too?
algorand-go-algorand
go
@@ -318,4 +318,11 @@ public interface DriverCommand { // Mobile API String GET_NETWORK_CONNECTION = "getNetworkConnection"; String SET_NETWORK_CONNECTION = "setNetworkConnection"; + + // Cast Media Router API + String GET_CAST_SINKS = "getCastSinks"; + String SET_CAST_SINK_TO_USE = "selectCastSink"; + Stri...
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
16,690
These command names are specific to Chromium-based browsers. Please move to `ChromiumDriverCommand`
SeleniumHQ-selenium
js
@@ -106,6 +106,13 @@ def _auto_patch(): import os import logging + from pyspark.sql import dataframe as df, functions as F + from databricks.koalas import functions + + for name in functions.__all__: + if not hasattr(F, name): + setattr(F, name, getattr(functions, name)) + # ...
1
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
1
15,278
Hm.. should we auto-patch? I am less sure on this yet as `percentile_approx` seems a Spark function and auto-patching it in Koalas seems a bit counterintuitive.
databricks-koalas
py
@@ -4,12 +4,14 @@ declare(strict_types=1); namespace Tests\ShopBundle\Test; +use Psr\Container\ContainerInterface; use Shopsys\FrameworkBundle\Component\DataFixture\PersistentReferenceFacade; use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Component\Environment\EnvironmentType; ...
1
<?php declare(strict_types=1); namespace Tests\ShopBundle\Test; use Shopsys\FrameworkBundle\Component\DataFixture\PersistentReferenceFacade; use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Component\Environment\EnvironmentType; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; ab...
1
18,914
I found domain use in `AllFeedsTest::getAllFeedExportCreationData` and class AllFeedsTest is descendant of `FunctionalTestCase`. I think so we can rewrite this too..
shopsys-shopsys
php
@@ -91,6 +91,13 @@ class IcebergFilesCommitter extends AbstractStreamOperator<Void> private transient Table table; private transient long maxCommittedCheckpointId; + // There're two cases that we restore from flink checkpoints: the first case is restoring from snapshot created by the + // same flink job; anot...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
23,943
I am wondering if it is better to consolidate all committer checkpoint states into a single structure, e.g. Pojo class or Avro record which are Flink supported state types for schema evolution.
apache-iceberg
java
@@ -56,9 +56,10 @@ class SignalFilter(QObject): Return: A partial function calling _filter_signals with a signal. """ - return functools.partial(self._filter_signals, signal, tab) + log_signal = debug.signal_name(signal) not in self.BLACKLIST + return functools.partia...
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
1
22,934
I assume this is a performance optimization to only check this once when creating the signal filter? While you're at it, maybe make `BLACKLIST` a set instead?
qutebrowser-qutebrowser
py
@@ -36,6 +36,18 @@ class DatabaseDriverNode { }); } + loadExtension(path) { + return new Promise((resolve, reject) => { + this.db_.loadExtension(path, (error) => { + if (error) { + reject(error); + return; + } + resolve(); + }); + }); + } + selectAll(sql, params = null) { if (!params)...
1
const sqlite3 = require('sqlite3').verbose(); const Promise = require('promise'); class DatabaseDriverNode { open(options) { return new Promise((resolve, reject) => { this.db_ = new sqlite3.Database(options.name, sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, error => { if (error) { reject(error); r...
1
15,183
Please use async/await and try/catch
laurent22-joplin
js
@@ -1065,11 +1065,9 @@ void GenStruct(StructDef &struct_def, std::string *code_ptr) { } } // generate object accessors if is nested_flatbuffer + if (field.nested_flatbuffer != nullptr) { auto nested = field.attributes.Lookup("nested_flatbuffer"); - if (nested) { - auto nested_qualified_name = - ...
1
/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
1
12,366
Like I said, this code looks incorrect. Why is it still looking up the attribute? Why is it getting the type from `nested->type.struct_def` instead of `field.nested_flatbuffer`? Are you running `generate_code.sh`, because I think `nested->type.struct_def` would be null?
google-flatbuffers
java
@@ -1664,6 +1664,7 @@ TEST_F(VkLayerTest, DescriptorUpdateTemplateEntryWithInlineUniformBlock) { m_device_extension_names.push_back(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); } else { printf("%s Push Descriptor Extension not supported, push descriptor cases skipped.\n", kSkipPrefix); + return...
1
/* * Copyright (c) 2015-2021 The Khronos Group Inc. * Copyright (c) 2015-2021 Valve Corporation * Copyright (c) 2015-2021 LunarG, Inc. * Copyright (c) 2015-2021 Google, Inc. * Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved. * * Licensed under the Apache License, Version 2....
1
19,357
Actually, I'm not sure why lines 1663-1668 are here. Looks like Push descriptors aren't used in the test at all. @ziga-lunarg?
KhronosGroup-Vulkan-ValidationLayers
cpp
@@ -250,7 +250,7 @@ public class NodeJSGapicContext extends GapicContext implements NodeJSContext { */ public List<String> fieldPropertyComment(Field field) { String commentType = fieldTypeCardinalityComment(field); - String fieldName = wrapIfKeywordOrBuiltIn(field.getSimpleName()); + String fieldName...
1
/* Copyright 2016 Google Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
1
18,074
Don't we still want to check it it's a keyword?
googleapis-gapic-generator
java
@@ -14,7 +14,7 @@ class AttachmentDecorator < Draper::Decorator class: "image-with-border" ) else - "<br><table><tr><td><strong><u>#{link_text}</u></strong></td></tr></table>" + "#{link_text}" end end
1
class AttachmentDecorator < Draper::Decorator include Rails.application.routes.url_helpers include ActionView::Helpers::AssetTagHelper include ActionView::Helpers::UrlHelper default_url_options[:host] = ::Rails.application.routes.default_url_options[:host] delegate_all def file_preview if file.content...
1
17,003
this can just me `link_text` :tomato:
18F-C2
rb
@@ -2045,3 +2045,15 @@ class SeriesTest(ReusedSQLTestCase, SQLTestUtils): kser = ks.from_pandas(pser) expected = pser self.assert_eq(kser.explode(), expected) + + def test_argsort(self): + pser = pd.Series(np.random.rand(5), index=np.random.rand(5), name="Koalas") + ...
1
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
1
16,402
What if the Series contains null values?
databricks-koalas
py
@@ -177,14 +177,11 @@ namespace Microsoft.CodeAnalysis.Sarif.Driver.Sdk { new Location { - AnalysisTarget = new List<PhysicalLocationComponent> - { - new PhysicalLocationComponent - ...
1
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using FluentAssertions; using Xunit; namespace Microsoft.CodeAnalysis.Sarif.Driver.Sdk { // These tests test the extension metho...
1
10,167
Every place you see a change like this, it's because `PhysicalLocation` is now its own object, not an array of `PhysicalLocationComponent` objects. The `Uri` is the key into the `FileInfo` dictionary.
microsoft-sarif-sdk
.cs
@@ -7,7 +7,7 @@ from mmdet.core.bbox.iou_calculators import bbox_overlaps from mmdet.models import HEADS from mmdet.models.dense_heads import ATSSHead -eps = 1e-12 +EPS = 1e-12 try: import sklearn.mixture as skm except ImportError:
1
import numpy as np import torch from mmcv.runner import force_fp32 from mmdet.core import multi_apply, multiclass_nms from mmdet.core.bbox.iou_calculators import bbox_overlaps from mmdet.models import HEADS from mmdet.models.dense_heads import ATSSHead eps = 1e-12 try: import sklearn.mixture as skm except ImportE...
1
21,418
Like in atss_head
open-mmlab-mmdetection
py
@@ -233,6 +233,16 @@ func (pool *TransactionPool) test(txgroup []transactions.SignedTxn) error { // requires a flat MinTxnFee). feePerByte = feePerByte * pool.feeThresholdMultiplier + // The threshold grows exponentially if there are multiple blocks + // pending in the pool. + if pool.numPendingWholeBlocks > 1 { ...
1
// Copyright (C) 2019 Algorand, Inc. // This file is part of go-algorand // // go-algorand is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any l...
1
36,611
nit : I think it would be better to have the multiplier being calculated along with `pool.numPendingWholeBlocks`, so that we could always multiply the feePerByte with that multiplier. Not only that it would be faster, but it would also have constant time. btw - Correct me if I'm wrong, but with this change, you're prac...
algorand-go-algorand
go
@@ -1,4 +1,5 @@ class CommentsController < ApplicationController + before_filter :authenticate_user! def index @commentable = find_commentable
1
class CommentsController < ApplicationController def index @commentable = find_commentable @comments = @commentable.comments end def create @commentable = find_commentable @comment = @commentable.comments.build(comment_params) if @comment.save flash[:notice] = "You successfully added a...
1
12,335
Is there a reason we _wouldn't_ want to do this? A bit of a security hole :grimacing:
18F-C2
rb
@@ -0,0 +1,14 @@ +package azkaban.project; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import org.yaml.snakeyaml.Yaml; + + +public class ProjectSpecLoader { + + public ProjectSpec load(File projectSpecFile) throws FileNotFoundException { + return new Yaml().loadA...
1
1
12,407
Please add a copyright notice to all new files. Is there a tool to check and auto update copyright notices?
azkaban-azkaban
java
@@ -132,7 +132,7 @@ class UserFormType extends AbstractType new Email(['message' => 'Please enter valid e-mail']), new UniqueEmail(['ignoredEmail' => $user !== null ? $user->getEmail() : null]), ], - 'label' => t('Email'), + 'label...
1
<?php namespace Shopsys\FrameworkBundle\Form\Admin\Customer; use Shopsys\FrameworkBundle\Component\Constraints\Email; use Shopsys\FrameworkBundle\Component\Constraints\FieldsAreNotIdentical; use Shopsys\FrameworkBundle\Component\Constraints\NotIdenticalToEmailLocalPart; use Shopsys\FrameworkBundle\Component\Constrain...
1
10,136
A new translation dump should be made after this change (removing the "Email" message)
shopsys-shopsys
php
@@ -9,7 +9,9 @@ function owns(node, virtualTree, role, ariaOwned) { if (node === null) { return false; } - var implicit = implicitNodes(role), + var implicit = implicitNodes(role).map( + implicitSelector => implicitSelector + ':not([role])' + ), selector = ['[role="' + role + '"]']; if (implicit) {
1
const requiredOwned = axe.commons.aria.requiredOwned; const implicitNodes = axe.commons.aria.implicitNodes; const matchesSelector = axe.utils.matchesSelector; const idrefs = axe.commons.dom.idrefs; const reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : []; function owns(node, virtua...
1
14,811
CI is failing saying `expected [TypeError: null is not an object (evaluating 'implicitNodes(role).map')] to equal null`.
dequelabs-axe-core
js
@@ -572,12 +572,12 @@ describe('createRoot()', () => { }); it('should avoid reapplying innerHTML when __html property of dangerouslySetInnerHTML attr remains unchanged', () => { + let thing; + class Thing extends Component { - constructor(props) { - super(props); - props.ref(this); - ...
1
import { setupRerender } from 'preact/test-utils'; import { createElement, Component, options, createRoot, Fragment } from 'preact'; import { setupScratch, teardown, getMixedArray, mixedArrayHTML, serializeHtml, supportsDataList, sortAttributes, spyOnElementAttributes, createEvent } from '../_util/helpers...
1
17,489
@JoviDeCroock I replaced the refs here with simple assignments.
preactjs-preact
js
@@ -84,7 +84,7 @@ public class TestHiveMetastore { private ExecutorService executorService; private TServer server; private HiveMetaStore.HMSHandler baseHandler; - private HiveClientPool clientPool; + protected HiveClientPool clientPool; // Exposed for testing. /** * Starts a TestHiveMetastore with ...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
29,601
nit: Could we use VisibleForTesting annotation here?
apache-iceberg
java
@@ -24,6 +24,10 @@ class PostTest < ActiveSupport::TestCase post.must :save end + it "should sort 'by_unanswered'" do + Post.by_unanswered.must_equal Post.joins(:topic).where("posts_count = '1'").order('created_at desc') + end + it 'posts should have an associated topic' do topic = create(:topic_...
1
# encoding: utf-8 require 'test_helper' class PostTest < ActiveSupport::TestCase before { create_must_and_wont_aliases(Post) } let(:topic) { create(:topic) } let(:post) { create(:post) } it 'a post without a body should not be able to save' do post.body = nil post.wont_be :valid? post.errors[:body...
1
7,235
Can we create some post records to assert sort_by
blackducksoftware-ohloh-ui
rb
@@ -178,6 +178,7 @@ func New(ctx context.Context, o Options) (*Service, error) { peerID := stream.Conn().RemotePeer() i, err := s.handshakeService.Handle(NewStream(stream), peerID) if err != nil { + _ = stream.Reset() if err == handshake.ErrNetworkIDIncompatible { s.logger.Warningf("peer %s has a di...
1
// Copyright 2020 The Swarm Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package libp2p import ( "context" "crypto/ecdsa" "errors" "fmt" "net" "github.com/ethersphere/bee/pkg/addressbook" "github.com/ethersphere/bee/pkg/l...
1
9,368
is this necessary?
ethersphere-bee
go
@@ -68,6 +68,8 @@ namespace Datadog.Trace.TestHelpers /// </summary> public int Port { get; } + public List<Func<Span, bool>> Filters { get; private set; } = new List<Func<Span, bool>>(); + public IImmutableList<Span> Spans { get; private set; } = ImmutableList<Span>.Empty; ...
1
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; using System.Collections.Specialized; using System.Diagnostics; using System.Linq; using System.Net; using System.Text; using System.Threading; using Datadog.Trace.ExtensionMethods; using MessagePack; namespac...
1
16,128
What is the purpose of this? It seems like it is used to indicate whether there is a filter on a span. But what filter? Could there eventually be multiple filters per span? Just not understanding.
DataDog-dd-trace-dotnet
.cs