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
@@ -1112,7 +1112,7 @@ func (c *client) flushOutbound() bool { } // Check to see if we can reuse buffers. - if len(cnb) > 0 { + if len(cnb) > 0 && n >= int64(len(cnb[0])) { oldp := cnb[0][:0] if cap(oldp) >= int(c.out.sz) { // Replace primary or secondary if they are nil, reusing same buffer.
1
// Copyright 2012-2020 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
10,042
Seems len(cnb[0]) will be the length after the write since of the *v thing we saw no?
nats-io-nats-server
go
@@ -37,6 +37,7 @@ var ( type QueueLoad struct { Key string Operation string + Object interface{} } func Start() error {
1
/* Copyright 2017 The OpenEBS 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 in writing, soft...
1
8,899
can we make use of storagepoolclaim type rather than the generic interface{} type?
openebs-maya
go
@@ -652,6 +652,8 @@ func (k *Kad) Start(_ context.Context) error { k.wg.Add(1) go k.manage() + k.AddPeers(k.previouslyConnected()...) + go func() { select { case <-k.halt:
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 kademlia import ( "context" random "crypto/rand" "encoding/json" "errors" "fmt" "math/big" "net" "sync" "syscall" "time" "github.com/eth...
1
15,801
this should happen before the `go k.manage()`, otherwise the node will always try the bootnodes first
ethersphere-bee
go
@@ -185,7 +185,7 @@ Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_ = function() { */ Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_ = function(connectionMap) { // Split the proc into components, by %n, %b, and %s (ignoring escaped). - var procComponents = this.procCode_.split(/(?=[^\\]\%[nbs])/); +...
1
/** * @license * Visual Blocks Editor * * Copyright 2012 Google Inc. * https://developers.google.com/blockly/ * * 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.apach...
1
9,070
Is this actually a lint related change?
LLK-scratch-blocks
js
@@ -15,6 +15,7 @@ module Blacklight::Document autoload :ActiveModelShim, 'blacklight/document/active_model_shim' autoload :SchemaOrg, 'blacklight/document/schema_org' + autoload :CacheKey, 'blacklight/document/cache_key' autoload :DublinCore, 'blacklight/document/dublin_core' autoload :Email, 'blacklight/...
1
## ## # = Introduction # Blacklight::Document is the module with logic for a class representing # an individual document returned from Solr results. It can be added in to any # local class you want, but in default Blacklight a SolrDocument class is # provided for you which is pretty much a blank class "include"ing # B...
1
5,961
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
projectblacklight-blacklight
rb
@@ -226,6 +226,12 @@ def opt_str_param(obj, param_name, default=None): return default if obj is None else obj +def opt_nonempty_str_param(obj, param_name, default=None): + if obj is not None and not isinstance(obj, string_types): + raise_with_traceback(_param_type_mismatch_exception(obj, str, param_n...
1
import inspect from future.utils import raise_with_traceback from six import string_types class CheckError(Exception): pass class ParameterCheckError(CheckError): pass class ElementCheckError(CheckError): pass class NotImplementedCheckError(CheckError): pass def _param_type_mismatch_excepti...
1
13,153
what does this do that str_param does not?
dagster-io-dagster
py
@@ -39,6 +39,11 @@ func GRPCDialOption(api string) grpc.DialOption { return grpc.WithUserAgent(userAgentString(api)) } +// AzureUserAgentPrefix returns a prefix that is used to set Azure SDK User-Agent to help with diagnostics. +func AzureUserAgentPrefix() string { + return fmt.Sprintf("%s/%s", prefix, version) +}...
1
// Copyright 2018 The Go Cloud 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
1
13,502
For GCP we included the API name (see below) so you can distinguish between uses other than `blob` once they exist, WDYT?
google-go-cloud
go
@@ -1,6 +1,14 @@ import os import pickle +from io import BytesIO + +try: + import boto3 + import botocore +except ImportError: + pass + from dagster import check, seven from dagster.utils import mkdir_p
1
import os import pickle from dagster import check, seven from dagster.utils import mkdir_p from .execution_context import SystemPipelineExecutionContext from .types.runtime import RuntimeType class ObjectStore: pass class FileSystemObjectStore(ObjectStore): def __init__(self, run_id): check.str_pa...
1
12,704
what would you think about doing this include on-demand within S3ObjectStore methods and then failing in a loud way?
dagster-io-dagster
py
@@ -2777,6 +2777,14 @@ void nano::active_transactions::confirm_frontiers (nano::transaction const & tra size_t elections_count (0); for (auto i (node.store.latest_begin (transaction_a, next_frontier_account)), n (node.store.latest_end ()); i != n && elections_count < max_elections; ++i) { + { + std::lock_...
1
#include <nano/node/node.hpp> #include <nano/crypto_lib/random_pool.hpp> #include <nano/lib/interface.h> #include <nano/lib/timer.hpp> #include <nano/lib/utility.hpp> #include <nano/node/common.hpp> #include <nano/rpc/rpc.hpp> #include <algorithm> #include <cstdlib> #include <future> #include <numeric> #include <sstr...
1
15,364
May be better make `stopped` atomic, then it can be just `for (auto i (node.store.latest_begin (transaction_a, next_frontier_account)), n (node.store.latest_end ()); i != n && && !stopped && elections_count < max_elections; ++i)`
nanocurrency-nano-node
cpp
@@ -165,7 +165,7 @@ folly::SemiFuture<StorageRpcResponse<cpp2::ExecResponse>> GraphStorageClient::ad evb, std::move(requests), [=](cpp2::GraphStorageServiceAsyncClient* client, const cpp2::AddEdgesRequest& r) { - return useToss ? client->future_addEdgesAtomic(r) : client->future_addEdges(r);...
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 "clients/storage/GraphStorageClient.h" #include "common/base/Base.h" namespace nebula { namespace storage { ...
1
30,350
In `src/storage/InternalStorageServiceHandler.h ` file, the client in `client->future_chainAddEdges ` should be InterStorageServiceAsyncClient?
vesoft-inc-nebula
cpp
@@ -22,6 +22,9 @@ import ( "strconv" "strings" + "github.com/prometheus/prometheus/pkg/rulefmt" + thanostypes "github.com/thanos-io/thanos/pkg/store/storepb" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" namespacelabeler "github.com/prometheus-operator/prometheus-o...
1
// Copyright 2016 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
16,495
`go.sum` needs to be updated for this. Please run `go mod tidy`
prometheus-operator-prometheus-operator
go
@@ -28,6 +28,17 @@ const ( MachineFinalizer = "awsmachine.infrastructure.cluster.x-k8s.io" ) +// SecretBackend defines variants for backend secret storage. +type SecretBackend string + +var ( + // SecretBackendSSMParameterStore defines AWS Systems Manager Parameter Store as the secret backend + SecretBackendSSMPar...
1
/* Copyright 2019 The Kubernetes 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 in writing, ...
1
16,848
Not sure if this was discussed previously, but is there a specific use case in mind for having this as an API field rather than a configuration option on the controller manager? Is there a specific use case in mind where one would want to choose different backends for individual Clusters/Machines vs having it a global ...
kubernetes-sigs-cluster-api-provider-aws
go
@@ -40,9 +40,11 @@ namespace OpenTelemetry.Metrics var options = new OtlpExporterOptions(); configure?.Invoke(options); - var metricExporter = new OtlpMetricsExporter(options); - var metricReader = new PeriodicExportingMetricReader(metricExporter, options.MetricExportIn...
1
// <copyright file="OtlpMetricExporterHelperExtensions.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry 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 // // ...
1
21,286
Same thing with the OtlpExporter
open-telemetry-opentelemetry-dotnet
.cs
@@ -70,7 +70,6 @@ const char * jx_operator_string( jx_operator_t type ) case JX_OP_NOT: return " not "; // note that the closing bracket/paren is in jx_print_subexpr case JX_OP_LOOKUP: return "["; - case JX_OP_CALL: return "("; case JX_OP_SLICE: return ":"; default: return "???"; }
1
/* Copyright (C) 2015- The University of Notre Dame This software is distributed under the GNU General Public License. See the file COPYING for details. */ #include "jx_print.h" #include "jx_parse.h" #include <assert.h> #include <ctype.h> void jx_comprehension_print(struct jx_comprehension *comp, buffer_t *b) { if ...
1
14,050
Should not be removed.
cooperative-computing-lab-cctools
c
@@ -1,17 +1,12 @@ -[ 'foss', 'puppet', 'ezbake', 'module' ].each do |lib| - require "beaker/dsl/install_utils/#{lib}_utils" -end require "beaker/dsl/install_utils/pe_defaults" +require 'beaker-puppet' module Beaker module DSL # Collection of installation methods and support module InstallUtils - ...
1
[ 'foss', 'puppet', 'ezbake', 'module' ].each do |lib| require "beaker/dsl/install_utils/#{lib}_utils" end require "beaker/dsl/install_utils/pe_defaults" module Beaker module DSL # Collection of installation methods and support module InstallUtils include DSL::InstallUtils::PuppetUtils includ...
1
14,978
Not a blocker for anything, but should this be moved to beaker-pe? Is that ticketed anywhere?
voxpupuli-beaker
rb
@@ -349,7 +349,9 @@ public class EventFiringWebDriver implements WebDriver, JavascriptExecutor, Take } public void submit() { + dispatcher.beforeClickOn(element, driver); element.submit(); + dispatcher.afterClickOn(element, driver); } public void sendKeys(CharSequence... keysToS...
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
12,685
this shouldn't be beforeClickOn, but rather beforeSubmit? and added to WebDriverEventListener. Since submit does not synthesize the 'click' events, this isn't accurate.
SeleniumHQ-selenium
java
@@ -119,7 +119,7 @@ module Ncr if self.pending? self.currently_awaiting_approvers.first.email_address else - self.approving_official.email_address + self.approving_official ? self.approving_official.email_address : self.system_approver_emails.first end end
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,517
this ternary operator is hiding an `if/else` within an `if/else` - any chance we could move the logic ELSEwhere? (see what I did there -- ?? :100: )
18F-C2
rb
@@ -4,6 +4,10 @@ package net.sourceforge.pmd.lang.java.typeresolution.typedefinition; +import net.sourceforge.pmd.annotation.InternalApi; + +@Deprecated +@InternalApi public interface TypeDefinition { /** * Get the raw Class type of the definition.
1
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ package net.sourceforge.pmd.lang.java.typeresolution.typedefinition; public interface TypeDefinition { /** * Get the raw Class type of the definition. * * @return Raw Class type. */ Class<?> getType(); ...
1
16,467
Is this really internal? Or will the API be different in PMD 7.0.0? Well, the interface doesn't offer much functionality anyway...
pmd-pmd
java
@@ -86,8 +86,12 @@ class Interface(param.Parameterized): datatype = None + # Denotes whether the interface expects gridded data gridded = False + # Denotes whether the interface expects multiple ragged arrays + multi = False + @classmethod def register(cls, interface): cls.in...
1
import param import numpy as np from ..element import Element from ..ndmapping import OrderedDict from .. import util class iloc(object): """ iloc is small wrapper object that allows row, column based indexing into a Dataset using the ``.iloc`` property. It supports the usual numpy and pandas iloc i...
1
18,994
Does it have to be arrays? Isn't it ragged 'data' (i.e multiple elements of different lengths)?
holoviz-holoviews
py
@@ -399,6 +399,7 @@ func (oi *OVFImporter) setUpImportWorkflow() (*daisy.Workflow, error) { if err != nil { return nil, fmt.Errorf("error parsing workflow %q: %v", ovfImportWorkflow, err) } + workflow.ForceCleanupOnError = true return workflow, nil }
1
// Copyright 2019 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 appl...
1
9,368
Per my understanding, this flag only impacts "NoCleanup" disk. If so, we may name it more clear. The reason of this ask is because I plan to add some other flag to force cleanup for other non-NoCleanup disks.
GoogleCloudPlatform-compute-image-tools
go
@@ -40,7 +40,7 @@ import org.apache.spark.sql.util.CaseInsensitiveStringMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class SparkStreamingWrite extends SparkBatchWrite implements StreamingWrite { +class SparkStreamingWrite extends BaseBatchWrite implements StreamingWrite { private stati...
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
27,469
In my changes for `RequiresDistributionAndOrdering`, this class went away and is replaced by an inner class. I think that pattern worked well. Maybe we could do that before this one to reduce the number of changes here.
apache-iceberg
java
@@ -95,10 +95,10 @@ const std::unordered_map<std::string, ItemParseAttributes_t> ItemParseAttributes {"magicpointspercent", ITEM_PARSE_MAGICPOINTSPERCENT}, {"criticalhitchance", ITEM_PARSE_CRITICALHITCHANCE}, {"criticalhitamount", ITEM_PARSE_CRITICALHITAMOUNT}, - {"hitpointsleechchance", ITEM_PARSE_HITPOINTSLEECH...
1
/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2018 Mark Samman <mark.samman@gmail.com> * * 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; eithe...
1
15,418
Shouldn't this be called `hp` instead of `life`?
otland-forgottenserver
cpp
@@ -106,7 +106,7 @@ public class BaseServer<T extends BaseServer> implements Server<T> { FilterHolder filterHolder = servletContextHandler.addFilter(CrossOriginFilter.class, "/*", EnumSet .of(DispatcherType.REQUEST)); - filterHolder.setInitParameter("allowedOrigins", "*"); + filte...
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,024
Because the default value of allowedOrigins is * (all origins), so it isn't necessary to set again at all.
SeleniumHQ-selenium
rb
@@ -5757,4 +5757,3 @@ bool Game::reload(ReloadTypes_t reloadType) } return true; } -
1
/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2019 Mark Samman <mark.samman@gmail.com> * * 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; eithe...
1
18,272
Undo this modification
otland-forgottenserver
cpp
@@ -170,7 +170,7 @@ namespace OpenTelemetry.Exporter.Zipkin.Tests var traceId = useShortTraceIds ? TraceId.Substring(TraceId.Length - 16, 16) : TraceId; Assert.Equal( - $@"[{{""traceId"":""{traceId}"",""name"":""Name"",""parentId"":""{ZipkinActivityConversionExtensions.EncodeS...
1
// <copyright file="ZipkinExporterTests.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry 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.a...
1
16,656
Please check my thoughts here... I changed the test to not `ToString()` attribute values. This was important to test things when `net.peer.port` was both an int or a string, but I was unsure if Zipkin supported non-string attributes.
open-telemetry-opentelemetry-dotnet
.cs
@@ -335,6 +335,8 @@ public class Camera extends Plugin { returnBase64(call, exif, bitmapOutputStream); } else if (settings.getResultType() == CameraResultType.URI) { returnFileURI(call, exif, bitmap, u, bitmapOutputStream); + } else if (settings.getResultType() == CameraResultType.BASE64NOMETADATA...
1
package com.getcapacitor.plugin; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; ...
1
7,738
Looks like you made changes on `CameraResultType` class, but didn't commit them. And you also have to do the changes on the types in @capacitor/core
ionic-team-capacitor
js
@@ -83,7 +83,7 @@ func buildImportParams() *ovfimportparams.OVFImportParams { ShieldedIntegrityMonitoring: *shieldedIntegrityMonitoring, ShieldedSecureBoot: *shieldedSecureBoot, ShieldedVtpm: *shieldedVtpm, Tags: *tags, Zone: *zoneFlag, BootDiskKmskey: *bootDiskKmskey, BootDiskKmsKeyring: *bootDiskKmsKeyring, ...
1
// Copyright 2019 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 appl...
1
9,607
Can you explain the history of the bug a bit, and why this fixes it?
GoogleCloudPlatform-compute-image-tools
go
@@ -0,0 +1,11 @@ +module MentorHelper + def mentor_image(mentor) + image_tag gravatar_url(mentor.email, size: '300') + end + + def mentor_contact_link(mentor) + mail_to mentor.email, + I18n.t('dashboard.show.contact_your_mentor', + mentor_name: mentor.first_name) + end +end
1
1
8,639
What do you think about `mentor_mail_to` or `mentor_mail_to_link` in order to match Rails' `mail_to` method, which is what this calls? I'm not sure about this suggestion...
thoughtbot-upcase
rb
@@ -80,7 +80,7 @@ namespace OpenTelemetry.Exporter { string valueDisplay = string.Empty; StringBuilder tagsBuilder = new StringBuilder(); - for (int i = 0; i < metricPoint.Keys.Length; i++) + for (int i = 0; i < ((metricPoi...
1
// <copyright file="ConsoleMetricExporter.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry 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....
1
21,381
Looks like this will make the check in every loop. Consider extracting the null check.
open-telemetry-opentelemetry-dotnet
.cs
@@ -11,6 +11,14 @@ module RSpec::Core expect(Module.private_methods & seg_methods).to eq([]) end + module SharedExampleGroup + describe Registry do + it 'can safely be reset' do + expect { Registry.clear }.to_not raise_error + end + end + end + %w[share_examples...
1
require 'spec_helper' module RSpec::Core describe SharedExampleGroup do ExampleModule = Module.new ExampleClass = Class.new it 'does not add a bunch of private methods to Module' do seg_methods = RSpec::Core::SharedExampleGroup.private_instance_methods expect(Module.private_methods & seg_me...
1
9,551
Maybe `it "can safely be reset when there are not yet any shared example groups"`? That's the edge case that wasn't working, right?
rspec-rspec-core
rb
@@ -19,7 +19,8 @@ import ( "fmt" "net/http" - "github.com/aws/amazon-ecs-agent/agent/asm/factory" + factory "github.com/aws/amazon-ecs-agent/agent/asm/factory" + ssmfactory "github.com/aws/amazon-ecs-agent/agent/ssm/factory" "github.com/aws/amazon-ecs-agent/agent/config" "github.com/aws/amazon-ecs-agent/agent...
1
// +build linux // Copyright 2017-2018 Amazon.com, Inc. or its affiliates. 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. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // o...
1
21,013
naming: please use `asmfactory`
aws-amazon-ecs-agent
go
@@ -54,9 +54,12 @@ func (c *Client) buildCommand(target *core.BuildTarget, inputRoot *pb.Directory, } // We can't predict what variables like this should be so we sneakily bung something on // the front of the command. It'd be nicer if there were a better way though... - const commandPrefix = "export TMP_DIR=\"`p...
1
package remote import ( "encoding/hex" "fmt" "io/ioutil" "os" "path" "runtime" "sort" "strings" pb "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/golang/protobuf/ptypes" "github.com/thought-machine/please/src/core" "github.com/thought-machine/please/src/fs" ) // uploadAc...
1
8,927
FYI you could use a raw string for this which removes the need for escaping the inner quotes.
thought-machine-please
go
@@ -984,3 +984,19 @@ class TestGetSetClipboard: def test_supports_selection(self, clipboard_mock, selection): clipboard_mock.supportsSelection.return_value = selection assert utils.supports_selection() == selection + + +@pytest.mark.parametrize('keystr, expected', [ + ('<Control-x>', True), + ...
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,790
2 blank lines here (between functions)
qutebrowser-qutebrowser
py
@@ -23,8 +23,13 @@ import java.util.Set; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; class BaseRewriteFiles extends MergingSnapshotProducer<RewriteFiles> implements RewriteFiles { + BaseRewriteFiles(String tableName, TableOperations ops) { - super(tableName, ops); + this(table...
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
34,542
Nit: we try to avoid whitespace changes because they can easily cause unnecessary commit conflicts.
apache-iceberg
java
@@ -1279,10 +1279,13 @@ class Codebase } foreach ($reference_map as $start_pos => [$end_pos, $possible_reference]) { - if ($offset < $start_pos || $possible_reference[0] !== '*') { + if ($offset < $start_pos) { continue; } - + // If the ...
1
<?php namespace Psalm; use Psalm\Internal\Analyzer\StatementsAnalyzer; use function array_combine; use function array_merge; use function count; use function error_log; use function explode; use function in_array; use function krsort; use function ksort; use LanguageServerProtocol\Command; use LanguageServerProtocol\P...
1
9,880
As mentioned below, I'm not sure why this is only allowing refs that are tagged with `*` at the start!
vimeo-psalm
php
@@ -59,4 +59,19 @@ class BackgroundRepository implements Repository { public void setFilter(CombinedAppsFilter filter) { delegatedRepository.setFilter(filter); } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getC...
1
/* * Copyright (C) 2015-2017 PÂRIS Quentin * * 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 your option) any later version. * * This program is...
1
9,394
Don't forget the {} symbols, and please use EqualsBuilder and HashcodeBuilder as possible
PhoenicisOrg-phoenicis
java
@@ -56,15 +56,17 @@ func TestPinger_Provider_Consumer_Ping_Flow(t *testing.T) { // Create provider's UDP proxy listener to which pinger should hand off connection. // In real world this proxy represents started VPN service (WireGuard or OpenVPN). - proxyBuf := make([]byte, 1024) + ch := make(chan string) go fun...
1
/* * Copyright (C) 2020 The "MysteriumNetwork/node" Authors. * * 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 3 of the License, or * (at your option) any later version. * ...
1
15,878
Allocate buffer once outside loop.
mysteriumnetwork-node
go
@@ -1262,3 +1262,11 @@ TEST (network, filter) node1.network.inbound (keepalive, std::make_shared<nano::transport::channel_loopback> (node1)); ASSERT_EQ (1, node1.stats.count (nano::stat::type::message, nano::stat::detail::invalid_network)); } + +TEST (network, fill_keepalive_self) +{ + nano::system system{ 2 }; + ...
1
#include <nano/node/transport/udp.hpp> #include <nano/test_common/network.hpp> #include <nano/test_common/system.hpp> #include <nano/test_common/testutil.hpp> #include <gtest/gtest.h> #include <boost/iostreams/stream_buffer.hpp> #include <boost/range/join.hpp> #include <boost/thread.hpp> using namespace std::chrono_...
1
16,878
It would be better to check that system.nodes[1]->network.port is somewhere in the target without specifying its exact position. But it is a very minor point and I have no string opinion on it just thought I'd mention it because our tests in general have too implementation detail.
nanocurrency-nano-node
cpp
@@ -43,8 +43,11 @@ public class WebApplicationExceptionHandler implements ExceptionMapper<WebApplic switch (ex.getResponse().getStatus()) { // BadRequest case 400: + // It's strange to have these "startsWith" conditionals here. They both come from Access.java. ...
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.errorhandlers; import edu.harvard.iq.dataverse.api.util.JsonResponseBuilder; import edu.harvard.i...
1
43,966
Should this be in a bundle?
IQSS-dataverse
java
@@ -291,9 +291,8 @@ namespace OpenTelemetry.Instrumentation.Http.Implementation private static void ProcessResult(IAsyncResult asyncResult, AsyncCallback asyncCallback, Activity activity, object result, bool forceResponseCopy) { - // We could be executing on a different thread now so set ...
1
// <copyright file="HttpWebRequestActivitySource.netfx.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry 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 // // ...
1
21,161
When Activity is lost (more precisely, ExecutionContext is lost) in the HttpModule we restore the root (HttpIn) Activity. That makes this assert invalid. I tried to fix the HttpModule so that it restores the Activity that was last running, but it is impossible to retrieve do to the way ExecutionContext works. It isn't ...
open-telemetry-opentelemetry-dotnet
.cs
@@ -63,13 +63,16 @@ func WrapNetwork(net network.GossipNode, log logging.Logger) agreement.Network { i.net = net i.log = log + return i +} + +func (i *networkImpl) Start() { handlers := []network.TaggedMessageHandler{ {Tag: protocol.AgreementVoteTag, MessageHandler: network.HandlerFunc(i.processVoteMessage)}...
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
37,867
what was the point in moving handlers registration into a separate method?
algorand-go-algorand
go
@@ -30,6 +30,9 @@ func newSyncCache(state *core.BuildState, remoteOnly bool) core.Cache { if state.Config.Cache.HTTPURL != "" { mplex.caches = append(mplex.caches, newHTTPCache(state.Config)) } + if state.Config.Cache.RetrieveCommand != "" { + mplex.caches = append(mplex.caches, newCmdCache(state.Config)) + } ...
1
// Caching support for Please. package cache import ( "sync" "gopkg.in/op/go-logging.v1" "github.com/thought-machine/please/src/core" ) var log = logging.MustGetLogger("cache") // NewCache is the factory function for creating a cache setup from the given config. func NewCache(state *core.BuildState) core.Cache...
1
10,379
At this point we probably want to ensure there's a store command set.
thought-machine-please
go
@@ -106,8 +106,13 @@ HDPrivateKey._getDerivationIndexes = function(path) { } var indexes = steps.slice(1).map(function(step) { - var index = parseInt(step); - index += step != index.toString() ? HDPrivateKey.Hardened : 0; + var index = step ? +step : NaN; + + var isHardened = isNaN(index) && step[st...
1
'use strict'; var assert = require('assert'); var buffer = require('buffer'); var _ = require('lodash'); var BN = require('./crypto/bn'); var Base58 = require('./encoding/base58'); var Base58Check = require('./encoding/base58check'); var Hash = require('./crypto/hash'); var Network = require('./networks'); var HDKey...
1
13,886
This code is way too complicated for what it does. I don't want to be a PITA, but what can you consider rewriting it in a simpler way? I'm talking about the whole `_getDerivationIndexes` function
bitpay-bitcore
js
@@ -151,6 +151,10 @@ namespace Nethermind.Vault.JsonRpc { try { + if (message.StartsWith("0x")) + { + throw new Exception($"Vault message should not be in hex; message: {message}"); + } string result = aw...
1
// Copyright (c) 2020 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
24,572
Don't throw base exception, specify more precise type
NethermindEth-nethermind
.cs
@@ -5,6 +5,16 @@ import torch def cast_tensor_type(inputs, src_type, dst_type): + """Recursive converted Tensor in inputs from src_type to dst_type. + + Args: + inputs: Inputs that to be casted. + src_type (torch.dtype): Source type.. + dst_type (torch.dtype): Destination type. + + Re...
1
from collections import abc import numpy as np import torch def cast_tensor_type(inputs, src_type, dst_type): if isinstance(inputs, torch.Tensor): return inputs.to(dst_type) elif isinstance(inputs, str): return inputs elif isinstance(inputs, np.ndarray): return inputs elif isi...
1
20,489
Recursive -> Recursively converted -> convert
open-mmlab-mmdetection
py
@@ -947,7 +947,8 @@ class CSharpGenerator : public BaseGenerator { } // JVM specifications restrict default constructor params to be < 255. // Longs and doubles take up 2 units, so we set the limit to be < 127. - if (has_no_struct_fields && num_fields && num_fields < 127) { + if ((has_no_...
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
17,932
why is this object API only? I think the reason why we didn't do this before was because this code was shared with Java which doesn't have value structs.
google-flatbuffers
java
@@ -432,7 +432,7 @@ func acsWsURL(endpoint, cluster, containerInstanceArn string, taskEngine engine. query.Set("agentVersion", version.Version) query.Set("seqNum", "1") if dockerVersion, err := taskEngine.Version(); err == nil { - query.Set("dockerVersion", "DockerVersion: "+dockerVersion) + query.Set("dockerVe...
1
// Copyright 2014-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license...
1
23,103
just to confirm, so backend will deal with both old format and new format?
aws-amazon-ecs-agent
go
@@ -91,7 +91,7 @@ namespace Datadog.Trace } private static T? ParseEnum<T>(IHeadersCollection headers, string headerName) - where T : struct + where T : struct, Enum { var headerValues = headers.GetValues(headerName).ToList();
1
using System; using System.Globalization; using System.Linq; using Datadog.Trace.Headers; using Datadog.Trace.Logging; namespace Datadog.Trace { internal class SpanContextPropagator { private const NumberStyles NumberStyles = System.Globalization.NumberStyles.Integer; private static readonly C...
1
14,824
huh, look at that, I wasn't aware you could constrain a type by Enum
DataDog-dd-trace-dotnet
.cs
@@ -229,6 +229,15 @@ PYBIND11_MODULE(ADIOS2_PYTHON_MODULE_NAME, m) const bool opBool = adios ? true : false; return opBool; }) + .def(pybind11::init<const bool>(), + "adios2 module starting point " + "non-MPI, constructs an ADIOS class " +...
1
/* * Distributed under the OSI-approved Apache License, Version 2.0. See * accompanying file Copyright.txt for details. * * py11glue.cpp * * Created on: Mar 16, 2017 * Author: William F Godoy godoywf@ornl.gov */ #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <sstream> #include <stdex...
1
14,176
Even though the debug parameter is effectively ignored, should this default to `false` instead of `true`?
ornladios-ADIOS2
cpp
@@ -0,0 +1,17 @@ +/* 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 appli...
1
1
16,098
What is the purpose of this interface? Unlike ParamDocView, it doesn't seem to be used anywhere to enable polymorphism
googleapis-gapic-generator
java
@@ -1,12 +1,11 @@ package startupshutdown import ( - "log" - "os" - "os/exec" "strings" + "github.com/google/uuid" "github.com/mholt/caddy" + "github.com/mholt/caddy/onevent/hook" ) func init() {
1
package startupshutdown import ( "log" "os" "os/exec" "strings" "github.com/mholt/caddy" ) func init() { caddy.RegisterPlugin("startup", caddy.Plugin{Action: Startup}) caddy.RegisterPlugin("shutdown", caddy.Plugin{Action: Shutdown}) } // Startup registers a startup callback to execute during server start. fu...
1
11,373
We added a library to generate a UUID for the request_id directive "github.com/nu7hatch/gouuid" can we uses the same one for what you want rather than add another dependency? Or if the google one is better can we remove the nu7hatch library?
caddyserver-caddy
go
@@ -161,16 +161,13 @@ func (p *Pinger) PingProvider(ip string, localPorts, remotePorts []int, proxyPor return localPort, remotePort, err } -func (p *Pinger) ping(conn *net.UDPConn, ttl int, stop <-chan struct{}) error { - // Windows detects that 1 TTL is too low and throws an exception during send - i := 0 - +func...
1
/* * Copyright (C) 2019 The "MysteriumNetwork/node" Authors. * * 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 3 of the License, or * (at your option) any later version. * ...
1
15,864
Shouldn't this be `i * Interval`? You're multiplying nanos with a Duration, I'm not sure what's the result :)
mysteriumnetwork-node
go
@@ -2513,7 +2513,7 @@ stack_alloc(size_t size, byte *min_addr) #else /* For UNIX we just mark it as inaccessible. */ if (!DYNAMO_OPTION(guard_pages)) - make_unwritable(guard, PAGE_SIZE); + set_protection(guard, PAGE_SIZE, MEMPROT_READ); #endif }
1
/* ********************************************************** * Copyright (c) 2010-2017 Google, Inc. All rights reserved. * Copyright (c) 2001-2010 VMware, Inc. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or witho...
1
12,525
I guess it's not no-access to match Windows where guard pages are readable.
DynamoRIO-dynamorio
c
@@ -103,7 +103,9 @@ module Ncr self.proposal.update(status: 'approved') else approvers = emails.map{|e| User.for_email(e)} + removed_approvers_to_notify = self.proposal.approvals.non_pending.map(&:user) - approvers self.proposal.approvers = approvers + Dispatcher.on_appro...
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 include ValueHelper include ...
1
13,670
Not a blocker, but would probably be useful to have a `scope :non_pending_approvers` on the `Proposal` model.
18F-C2
rb
@@ -94,6 +94,16 @@ class TaskException(Exception): pass +GetWorkResponse = collections.namedtuple('GetWorkResponse', ( + 'task_id', + 'running_tasks', + 'n_pending_tasks', + 'n_unique_pending', + 'n_pending_last_scheduled', + 'worker_state' +)) + + class TaskProcess(multiprocessing.Process):...
1
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
1
15,864
Add trailing comma
spotify-luigi
py
@@ -28,7 +28,7 @@ func StartModules() { // GracefulShutdown is if it gets the special signals it does modules cleanup func GracefulShutdown() { c := make(chan os.Signal) - signal.Notify(c, syscall.SIGINT, syscall.SIGHUP, syscall.SIGTERM, syscall.SIGKILL, + signal.Notify(c, syscall.SIGINT, syscall.SIGHUP, syscall.SI...
1
package core import ( "os" "os/signal" "syscall" "k8s.io/klog" beehiveContext "github.com/kubeedge/beehive/pkg/core/context" ) // StartModules starts modules that are registered func StartModules() { beehiveContext.InitContext(beehiveContext.MsgCtxTypeChannel) modules := GetModules() for name, module := ra...
1
18,160
I see someone say SIGKILL can not be caught by process. The original code here about `SIGKILL` is useless?
kubeedge-kubeedge
go
@@ -241,6 +241,7 @@ class Setting extends BaseModel { let output = {}; output[Setting.THEME_LIGHT] = _('Light'); output[Setting.THEME_DARK] = _('Dark'); + output[Setting.THEME_OLED_DARK] = _('OLED dark'); if (platform !== 'mobile') { output[Setting.THEME_DRACULA] = _('Dracula'); ...
1
const BaseModel = require('lib/BaseModel.js'); const { Database } = require('lib/database.js'); const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); const { time } = require('lib/time-utils.js'); const { sprintf } = require('sprintf-js'); const ObjectUtils = require('lib/ObjectUtils'); const { toTitleCase }...
1
11,377
As it is a mobile only theme, please make sure the option appears only on mobile
laurent22-joplin
js
@@ -364,3 +364,14 @@ def _get_non_negative_param(param, default=None): if value < 0: raise APIBadRequest("'{}' should be a non-negative integer".format(param)) return value + + +def parse_param_list(params): + param_list = [] + for param in params.split(","): + param = param.stri...
1
import listenbrainz.webserver.rabbitmq_connection as rabbitmq_connection import listenbrainz.webserver.redis_connection as redis_connection import pika import pika.exceptions import sys import time import ujson import uuid from flask import current_app, request from listenbrainz.listen import Listen from listenbrainz....
1
17,015
Would like a docstring and type annotations here
metabrainz-listenbrainz-server
py
@@ -11,7 +11,7 @@ module Mongoid included do cattr_accessor :shard_key_fields - self.shard_key_fields = [] + self.shard_key_fields = {} end # Get the shard key fields.
1
# frozen_string_literal: true # encoding: utf-8 module Mongoid # This module contains behavior for adding shard key fields to updates. # # @since 4.0.0 module Shardable extend ActiveSupport::Concern included do cattr_accessor :shard_key_fields self.shard_key_fields = [] end # Get...
1
12,292
This is an API change. Why was it made?
mongodb-mongoid
rb
@@ -1,5 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. +using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Tracing; + namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery { using System;
1
// Copyright (c) Microsoft. All rights reserved. namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using Microsoft....
1
11,094
Please move using inside namespace.
microsoft-vstest
.cs
@@ -511,7 +511,7 @@ namespace Nethermind.Blockchain } } - private AddBlockResult Suggest(Block? block, BlockHeader header, bool shouldProcess = true, bool? setAsMain = null) + private AddBlockResult Suggest(Block? block, BlockHeader header, bool shouldProcess = true, bool? setAsMai...
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,227
shall we create some enum flags for setasmain shouldprocess and pos?
NethermindEth-nethermind
.cs
@@ -141,6 +141,16 @@ exit /B %errorlevel% # therefore, this command will always exit 0 if either service is installed on host, Command.new("sc query puppet || sc query pe-puppet", [], { :cmdexe => true }) + # (PA-514) value for PUPPET_AGENT_STARTUP_MODE should be present in + ...
1
module Beaker module DSL module InstallUtils # # This module contains methods useful for Windows installs # module WindowsUtils # Given a host, returns it's system TEMP path # # @param [Host] host An object implementing {Beaker::Hosts}'s interface. # ...
1
13,677
Should this `PUPPET_AGENT_STARTUP_MODE` have a corresponding yardoc change?
voxpupuli-beaker
rb
@@ -17,15 +17,10 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. +# pylint: disable=unused-import import pytest import pytest_bdd as bdd -# pylint: disable=unused-import from end2end.features.test_yankpaste_bdd import...
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-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,868
Why not simply remove the `pytest` import now that it's not needed anymore? :wink:
qutebrowser-qutebrowser
py
@@ -0,0 +1,12 @@ +// Copyright (c) Microsoft. All Rights Reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Microsoft.CodeAnalysis.Sarif.Core +{ + [TestClass] + public cla...
1
1
10,811
Yeah, not filled in yet.
microsoft-sarif-sdk
.cs
@@ -28,6 +28,13 @@ </div> </div> + <div class="row"> + <div class="form-group col-xs-12"> + <%= f.check_box :active, style: 'width: auto' %> + <%= f.label :active, _('Active'), class: 'control-label' %> + </div> + </div> + <div class="row"> <div class="form-group col-xs-6"> <%...
1
<% url = @notification.new_record? ? super_admin_notifications_path : super_admin_notification_path(@notification) %> <%= form_for @notification, url: url, html: { class: 'notification' } do |f| %> <div class="row"> <div class="form-group col-xs-10"> <%= f.label :title, _('Title'), class: 'control-label' %...
1
18,932
don't use style. Use a class instead. reducing `col-xs-12` down to 8 or 6 or whatever should do the trick
DMPRoadmap-roadmap
rb
@@ -218,6 +218,13 @@ public class Catalog implements AutoCloseable { Objects.requireNonNull(database, "database is null"); Objects.requireNonNull(tableName, "tableName is null"); TiTableInfo table = metaCache.getTable(database, tableName); + + if (table == null) { + // reload cache if table not e...
1
/* * Copyright 2017 PingCAP, 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 ...
1
9,818
should we also do `reloadCache` when database is null?
pingcap-tispark
java
@@ -47,6 +47,15 @@ void SetMCSBondTyper(MCSParameters &p, BondComparator bondComp) { } } +ROMol *getQueryMol(MCSResult &mcsRes) { + ROMol *res; + { + NOGIL gil; + res = new ROMol(*mcsRes.QueryMol); + } + return res; +} + MCSResult *FindMCSWrapper(python::object mols, bool maximizeBonds, ...
1
// // Copyright (C) 2014 Novartis Institutes for BioMedical Research // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #include <RDBoost/pyt...
1
20,046
Why not just return QueryMol directly? Why require the copy?
rdkit-rdkit
cpp
@@ -84,6 +84,15 @@ def retry_test(func): assert success return result + +def scapy_path(fname): + """Resolves a path relative to scapy's root folder""" + if fname.startswith('/'): + fname = fname[1:] + return os.path.abspath(os.path.join( + os.path.dirname(__file__), '../../', fname +...
1
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ Unit testing infrastructure for Scapy """ from __future__ import print_function import bz2 import copy import code impor...
1
18,511
Could you add a docstring?
secdev-scapy
py
@@ -23,4 +23,5 @@ module ApplicationHelper def display_search_ui? current_user && current_user.client_model && !client_disabled? end + end
1
module ApplicationHelper def controller_name params[:controller].gsub(/\W/, "-") end def display_return_to_proposal controller.is_a?(ProposalsController) && params[:action] == "history" end def display_return_to_proposals controller.is_a?(ClientDataController) || (controller.is_a?(Proposal...
1
16,698
looks like you added newlines after blocks in a few files - I generally like newlines before/after multi-line blocks _except_ when the end the block is directly nested inside another block (eg: two `end`s next to each other) what do you think?
18F-C2
rb
@@ -46,7 +46,7 @@ public class EqualsVisitor implements GenericVisitor<Boolean, Visitable> { } private EqualsVisitor() { - // hide constructor + // hide constructor } /**
1
/* * Copyright (C) 2007-2010 Júlio Vilmar Gesser. * Copyright (C) 2011, 2013-2020 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
14,037
@jlerbsc 's fix in #2918 in action - thanks! :smiling_face_with_three_hearts:
javaparser-javaparser
java
@@ -33,12 +33,15 @@ class ArgInfo: """Information about an argument.""" - def __init__(self, win_id=False, count=False, flag=None, hide=False, - metavar=None, completion=None, choices=None): + def __init__(self, win_id=False, count=False, hide=False, metavar=None, + zero_c...
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
16,571
nitpick: Please lower-case `Zero_count` (as it's a literal argument name) and `Argument` here.
qutebrowser-qutebrowser
py
@@ -2693,7 +2693,7 @@ func (a *Account) hasIssuer(issuer string) bool { // hasIssuerNoLock is the unlocked version of hasIssuer func (a *Account) hasIssuerNoLock(issuer string) bool { // same issuer - if a.Issuer == issuer { + if a.Name == issuer { return true } for i := 0; i < len(a.signingKeys); i++ {
1
// Copyright 2018-2020 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
12,006
change the name of the function to match its functionality? account IsIssuing?
nats-io-nats-server
go
@@ -84,6 +84,19 @@ class _Frame(object): """ return _spark_col_apply(self, F.abs) + def groupby(self, by): + from databricks.koalas.groupby import GroupBy + from databricks.koalas.series import Series + if isinstance(by, str): + by = [by] + elif isinstance(b...
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
8,598
for later: add docstring (can just copy paste Pandas')
databricks-koalas
py
@@ -4,10 +4,10 @@ package cli import ( - "fmt" "testing" climocks "github.com/aws/amazon-ecs-cli-v2/internal/pkg/cli/mocks" + archerMocks "github.com/aws/amazon-ecs-cli-v2/mocks" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" )
1
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package cli import ( "fmt" "testing" climocks "github.com/aws/amazon-ecs-cli-v2/internal/pkg/cli/mocks" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) const githubRepo = "h...
1
11,005
nit: @sonofachamp pointed out to me that the idiomatic way is "archermocks" (lowercase for package names)
aws-copilot-cli
go
@@ -31,8 +31,7 @@ import ( ) var ( - errRouterNotSet = errors.New("router not set") - errRouterHasNoProcedures = errors.New("router has no procedures") + errRouterNotSet = errors.New("router not set") _ transport.Inbound = (*Inbound)(nil) )
1
// Copyright (c) 2017 Uber Technologies, Inc. // // 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...
1
14,857
Ugh I'm stupid, can you change this to `yarpc.InternalErrorf`?
yarpc-yarpc-go
go
@@ -42,10 +42,16 @@ import org.apache.iceberg.util.ThreadPools; public class AllDataFilesTable extends BaseMetadataTable { private final TableOperations ops; private final Table table; + private final String name; public AllDataFilesTable(TableOperations ops, Table table) { + this(ops, table, table.name...
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
25,827
We instantiate some metadata tables in tests so I kept the old constructor too. Won't harm if someone is using it directly too.
apache-iceberg
java
@@ -4424,11 +4424,15 @@ function _execPopulateQuery(mod, match, select, assignmentOpts, callback) { limit: mod.options.limit, perDocumentLimit: mod.options.perDocumentLimit }, mod.options.options); + if (mod.count) { delete queryOptions.skip; } - if (queryOptions.perDocumentLimit != null) { +...
1
'use strict'; /*! * Module dependencies. */ const Aggregate = require('./aggregate'); const ChangeStream = require('./cursor/ChangeStream'); const Document = require('./document'); const DocumentNotFoundError = require('./error/notFound'); const DivergentArrayError = require('./error/divergentArray'); const EventEm...
1
14,148
I think the better place to put this might be `lib/options/PopulateOptions.js`. That should make it easier - checking options in `populate()` can get confusing.
Automattic-mongoose
js
@@ -41,13 +41,13 @@ var ( // NATProviderPinger pings provider and optionally hands off connection to consumer proxy. type NATProviderPinger interface { - PingProvider(ip string, providerPort, consumerPort, proxyPort int, stop <-chan struct{}) error + PingProvider(params Params, proxyPort int) (*net.UDPConn, error) ...
1
/* * Copyright (C) 2019 The "MysteriumNetwork/node" Authors. * * 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 3 of the License, or * (at your option) any later version. * ...
1
15,786
Lets have simple function arguments here, because now struct `traversal.Params` started to have 2 purposes: 1. used as contract in DTO between consumer-provider 2. as function parameters for internal code calls
mysteriumnetwork-node
go
@@ -0,0 +1,5 @@ +package org.openqa.selenium.grid.distributor.remote; + +public class RemoteDistributorTest { + +}
1
1
16,857
Probably best not to have an empty test....
SeleniumHQ-selenium
js
@@ -0,0 +1,7 @@ +<figure> + <img src="/assets/upcase/testimonial_thumbs/anthony-lee.jpg" alt="Anthony"> + <p class="quotee">Anthony Lee<strong>Professional</strong> </p> +</figure> +<blockquote> + <p><strong>I am really loving upcase.</strong> The most valuable part for me was how I was able to dissect "upcase" app ...
1
1
11,601
`image_tag` in the `testimonials` files?
thoughtbot-upcase
rb
@@ -255,9 +255,10 @@ public class ExecutionFlowDao { + "SET status=?,update_time=?,start_time=?,end_time=?,enc_type=?,flow_data=? " + "WHERE exec_id=?"; - final String json = JSONUtils.toJSON(flow.toObject()); byte[] data = null; try { + // If this action fails, the executi...
1
/* * Copyright 2017 LinkedIn Corp. * * 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
19,263
I believe flow.toObject() method is throwing NPE if SLA option list (i.e. this.executionOptions.getSlaOptions()) is null or one of the value in the list (i.e. this.executionOptions.getSlaOptions()) is null. If that is the case we could fix root cause of NPE in the ExecutableFlow.toObject() method. The corresponding cod...
azkaban-azkaban
java
@@ -33,7 +33,7 @@ export default Controller.extend(SettingsSaveMixin, { }), iconImageSource: computed('model.icon', function () { - return this.get('model.icon') || ''; + return this.get('model.icon') || '/favicon.ico'; }), coverImageSource: computed('model.cover', function () {
1
import Controller from 'ember-controller'; import computed, {notEmpty} from 'ember-computed'; import injectService from 'ember-service/inject'; import observer from 'ember-metal/observer'; import run from 'ember-runloop'; import SettingsSaveMixin from 'ghost-admin/mixins/settings-save'; import randomPassword from 'ghos...
1
7,808
So I haven't tested this - but since the icon location is just directly dumped into the img _src_ attribute, won't this cause issues with Ghost blogs in a subdirectory? If I'm misunderstanding what the purpose of the default is then let me know
TryGhost-Admin
js
@@ -120,8 +120,16 @@ int main(int argc, char **argv) MPI_Init(nullptr, nullptr); #endif - ::testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); + int result = -1; + try + { + ::testing::InitGoogleTest(&argc, argv); + result = RUN_ALL_TESTS(); + } + catch (std...
1
/* * Distributed under the OSI-approved Apache License, Version 2.0. See * accompanying file Copyright.txt for details. * * TestBPWriteTypes.c * * Created on: Aug 9, 2017 * Author: Haocheng */ #include <adios2_c.h> #ifdef ADIOS2_HAVE_MPI #include <mpi.h> #endif #include <gtest/gtest.h> #include "Smal...
1
12,132
Why swallow the exception here rather than propagate it?
ornladios-ADIOS2
cpp
@@ -340,7 +340,8 @@ class _InternalFrame(object): index_map: Optional[List[IndexMap]] = None, scol: Optional[spark.Column] = None, data_columns: Optional[List[str]] = None, - column_index: Optional[List[Tuple[str]]] = None) -> None: + ...
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
10,854
How about `column_index_names`? `column_names` sounds ambiguous.
databricks-koalas
py
@@ -89,6 +89,7 @@ public class TableProperties { public static final String METADATA_COMPRESSION = "write.metadata.compression-codec"; public static final String METADATA_COMPRESSION_DEFAULT = "none"; + public static final String METRICS_MODE_COLUMN_CONF_PREFIX = "write.metadata.metrics.column."; public sta...
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
14,522
+1 on this. Do we want to have it as `WRITE_METRICS_MODE_COLUMN_CONF_PREFIX` to be consistent with defaults? Is there a possibility we will have `READ_METRICS_MODE_COLUMN_CONF_PREFIX`? Not sure.
apache-iceberg
java
@@ -2264,8 +2264,8 @@ class DataFrameTest(ReusedSQLTestCase, SQLTestUtils): def test_cumprod(self): pdf = pd.DataFrame( - [[2.0, 1.0], [5, None], [1.0, 1.0], [2.0, 4.0], [4.0, 9.0]], - columns=list("AB"), + [[2.0, 1.0, 1], [5, None, 2], [1.0, 1.0, 3], [2.0, 4.0, 4], [4.0...
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,192
Shall we use different inputs for `PySpark < 2.4` where `transpose` won't work with different data types.
databricks-koalas
py
@@ -20,8 +20,11 @@ Wrappers around spark that correspond to common pandas functions. import pyspark import numpy as np import pandas as pd +from ._dask_stubs.compatibility import string_types +from ._dask_stubs.utils import derived_from from .typing import Col, pandas_wrap -from pyspark.sql import Column, DataFrame...
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
8,215
we should sort the headers like in spark: public packages, then pyspark, then internal
databricks-koalas
py
@@ -53,7 +53,9 @@ func newPeer(address string, t *Transport) (*grpcPeer, error) { grpc.MaxCallSendMsgSize(t.options.clientMaxSendMsgSize), ), } - if t.options.clientTLS { + if t.options.clientTLSConfig != nil { + dialOptions = append(dialOptions, grpc.WithTransportCredentials(credentials.NewTLS(t.options.clie...
1
// Copyright (c) 2018 Uber Technologies, Inc. // // 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...
1
16,632
looks like we should drop this var from the transport options struct
yarpc-yarpc-go
go
@@ -721,17 +721,6 @@ func TestValidateDuration(t *testing.T) { }, errs: []*field.Error{field.Invalid(fldPath.Child("renewBefore"), usefulDurations["ten years"].Duration, fmt.Sprintf("certificate duration %s must be greater than renewBefore %s", cmapi.DefaultCertificateDuration, usefulDurations["ten years"].Dura...
1
/* Copyright 2020 The cert-manager 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 in writing...
1
27,348
Ah, yeah, this is the test for the validation that I mentioned in a remark above about relaxing the validation.
jetstack-cert-manager
go
@@ -21,6 +21,19 @@ def anchor_inside_flags(flat_anchors, valid_flags, img_shape, allowed_border=0): + """Check whether the anchors are inside the border + + Args: + flat_anchors (torch.Tensor): Flatten anchors + valid_flags (...
1
import torch def images_to_levels(target, num_levels): """Convert targets by image to targets by feature level. [target_img0, target_img1] -> [target_level0, target_level1, ...] """ target = torch.stack(target, 0) level_targets = [] start = 0 for n in num_levels: end = start + n ...
1
20,472
For tensors, it is better to illustrate the shape.
open-mmlab-mmdetection
py
@@ -42,6 +42,11 @@ describe( 'Site Kit admin bar component display', () => { status: 200, body: JSON.stringify( mockBatchResponse[ 'modules::search-console::searchanalytics::e74216dd17533dcb67fa2d433c23467c' ] ), } ); + } else if ( request.url().match( 'google-site-kit/v1/data/' ) ) { + request.re...
1
/** * WordPress dependencies */ import { activatePlugin, createURL } from '@wordpress/e2e-test-utils'; /** * Internal dependencies */ import { setEditPostFeature, setSiteVerification, setSearchConsoleProperty, useRequestInterception, } from '../../../utils'; import * as adminBarMockResponses from './fixtures/a...
1
36,078
This was removed in a recent PR for the admin bar, but should have been kept. It's been restored in the other admin bar PR but I've added it here to for completeness.
google-site-kit-wp
js
@@ -127,6 +127,15 @@ namespace OpenTelemetry.Instrumentation.AspNetCore.Tests Assert.Equal(2, activityProcessor.Invocations.Count); // begin and end was called var activity = (Activity)activityProcessor.Invocations[1].Arguments[0]; +#if !NETCOREAPP2_1 + // ASP.NET Core after 2.x i...
1
// <copyright file="BasicTests.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry 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...
1
17,178
nit: probably swap the if condition and `if/else` and check `NETCOREAPP2_1` which looks more natural.
open-telemetry-opentelemetry-dotnet
.cs
@@ -486,12 +486,13 @@ func (a *Account) IsExportService(service string) bool { // IsExportServiceTracking will indicate if given publish subject is an export service with tracking enabled. func (a *Account) IsExportServiceTracking(service string) bool { a.mu.RLock() - defer a.mu.RUnlock() ea, ok := a.exports.serv...
1
// Copyright 2018-2019 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
9,372
for the tag, should it be `requestor_rtt` since the other is `responder_rtt`?
nats-io-nats-server
go
@@ -99,6 +99,15 @@ func (rcv *Monster) InventoryBytes() []byte { return nil } +func (rcv *Monster) MutateInventory(j int, n byte) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + if o != 0 { + a := rcv._tab.Vector(o) + return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) + } + return false +} + f...
1
// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example import ( flatbuffers "github.com/google/flatbuffers/go" MyGame "MyGame" ) /// an example documentation comment: monster object type Monster struct { _tab flatbuffers.Table } func GetRootAsMonster(buf []byte, offset flatbuffers.UOffsetT)...
1
15,269
The one sad part of this is that is will generate a lot of overhead if you loop through a vector, since it obtains the vector every time. But with the current API there is no alternative I guess, and it is better to have the option than not.
google-flatbuffers
java
@@ -8,6 +8,7 @@ import ( "time" "github.com/filecoin-project/go-filecoin/types" + files "github.com/ipfs/go-ipfs-files" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require"
1
package commands_test import ( "context" "math/big" "strings" "testing" "time" "github.com/filecoin-project/go-filecoin/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/filecoin-project/go-filecoin/fixtures" tf "github.com/filecoin-project/go-filecoin/testhelper...
1
20,899
nit: there should be a newline between `types` and `go-ipfs-files`.
filecoin-project-venus
go
@@ -0,0 +1,5 @@ +package reacher + +var ( + RetryAfter = &retryAfterDuration +)
1
1
15,710
would be nice to have this as a parameter (Options), re: technical debt discussions
ethersphere-bee
go
@@ -10,10 +10,13 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; +import org.apache.commons.lang3.ArrayUtils; + import net.sourceforge.pmd.PMDVersion; import net.sourceforge.pmd.util.fxdesigner.app.DesignerRoot; import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil;...
1
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ package net.sourceforge.pmd.util.fxdesigner; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import net.sourceforge.pmd.PMDVersion; import ...
1
15,441
complete ignorance here but is it ok to import this from `com.sun`? can it break under non-oracle JREs?
pmd-pmd
java
@@ -61,6 +61,13 @@ func (tr *tracer) Start(ctx context.Context, name string, o ...apitrace.SpanOpti span := startSpanInternal(name, parent, remoteParent, opts) span.tracer = tr + if span.IsRecordingEvents() { + sps, _ := spanProcessors.Load().(spanProcessorMap) + for sp := range sps { + sp.OnStart(span.data) ...
1
// Copyright 2019, OpenTelemetry 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 ag...
1
9,781
Is this some way of saying that the span is going to be sampled? I'm basing this question on the condition I saw for the `OnEnd` to be called - `mustExport := s.spanContext.IsSampled() && )`. Shouldn't the condition be `s.spanContext.IsSampled()` to match the condition for calling the `OnEnd`?
open-telemetry-opentelemetry-go
go
@@ -650,6 +650,13 @@ func (c *CStorVolumeReplicaController) syncCvr(cvr *apis.CStorVolumeReplica) { } else { cvr.Status.Capacity = *capacity } + + err = volumereplica.GetAndUpdateSnapshotInfo(c.clientset, cvr) + if err != nil { + klog.Errorf( + "Unable to update snapshot list details in cvr %s status err: %v"...
1
/* Copyright 2018 The OpenEBS 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 in writing, sof...
1
18,255
just calling UpdateSnapshotInfo() should be fine
openebs-maya
go
@@ -156,8 +156,8 @@ namespace Datadog.Trace.Logging return rate; } - // We don't want to rate limit messages by default when in debug mode - return GlobalSettings.Source.DebugEnabled ? 0 : DefaultLogMessageRateLimit; + // By default, we don't rate limit l...
1
using System; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using Datadog.Trace.Configuration; using Datadog.Trace.Util; using Datadog.Trace.Vendors.Serilog; using Datadog.Trace.Vendors.Serilog.Core; using Datadog.Trace.Vendors.Serilog.Events; using Datadog.Trace.Vendors.Serilog.Sinks...
1
19,586
Was `DefaultLogMessageRateLimit` not configurable anywhere?
DataDog-dd-trace-dotnet
.cs