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
@@ -36,8 +36,8 @@ import com.salesforce.androidsdk.smartstore.store.QuerySpec; import com.salesforce.androidsdk.smartstore.store.QuerySpec.QueryType; import com.salesforce.androidsdk.smartstore.store.SmartStore; import com.salesforce.androidsdk.smartstore.store.SmartStore.SmartStoreException; -import com.salesforce....
1
/* * Copyright (c) 2011-2015, salesforce.com, inc. * All rights reserved. * Redistribution and use of this software in source and binary forms, with or * without modification, are permitted provided that the following conditions * are met: * - Redistributions of source code must retain the above copyright notice,...
1
15,251
Took the opportunity to fix the import ordering.
forcedotcom-SalesforceMobileSDK-Android
java
@@ -130,9 +130,13 @@ class XRDCalculator(AbstractDiffractionPatternCalculator): """ if isinstance(wavelength, float): self.wavelength = wavelength - else: + elif isinstance(wavelength, int): + self.wavelength = float(wavelength) + elif isinstance(wavelength...
1
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module implements an XRD pattern calculator. """ import json import os from math import asin, cos, degrees, pi, radians, sin import numpy as np from pymatgen.symmetry.analyzer import SpacegroupAnaly...
1
19,647
I think int and float can be handled in one if statement. The subsequent calculations don't really care whether it si a float or an int.
materialsproject-pymatgen
py
@@ -134,14 +134,14 @@ func TestDelayedCancellationEnabled(t *testing.T) { t.Parallel() ctx, cancel := makeContextWithDelayedCancellation(t) - EnableDelayedCancellationWithGracePeriod(ctx, 15*time.Millisecond) + EnableDelayedCancellationWithGracePeriod(ctx, 50*time.Millisecond) cancel() select { case <-c...
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "testing" "time" "golang.org/x/net/context" ) type testDCKeyType int const ( testDCKey testDCKeyType = iota ) func TestReplayableContex...
1
16,951
Can we keep this at 10 to reduce the probability of a flake? Or are you afraid this would be too likely to give a false positive if delayed cancellation is every actually broken?
keybase-kbfs
go
@@ -15,9 +15,14 @@ package gcsblob import ( + "context" + "fmt" + "net/http" "strings" "testing" + "github.com/google/go-x-cloud/gcp" + "google.golang.org/api/googleapi" )
1
// Copyright 2018 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
10,154
nit: add a blank line under this.
google-go-cloud
go
@@ -67,6 +67,7 @@ var ( bytecodeFlag = flag.NewStringVarP("bytecode", "b", "", "set the byte code") yesFlag = flag.BoolVarP("assume-yes", "y", false, "answer yes for all confirmations") passwordFlag = flag.NewStringVarP("password", "P", "", "input password for account") + chainIDFlag = flag.NewUint64VarP("c...
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
23,634
no need to add this flag query the endpoint set-up to determine the chainID
iotexproject-iotex-core
go
@@ -0,0 +1,9 @@ +if (node.querySelector('input[type="submit"], img[type="submit"], button[type="submit"]')) { + return true; +} + +if (!node.querySelectorAll(':not(textarea)').length) { + return false; +} + +return undefined;
1
1
13,237
Here is a few scenario - What if there is a submit button with in a form, but is always disabled?
dequelabs-axe-core
js
@@ -1498,6 +1498,7 @@ const instr_info_t * const op_instr[] = #define Wed TYPE_W, OPSZ_16_vex32_evex64 #define Vex TYPE_V, OPSZ_16_vex32_evex64 #define Wex TYPE_W, OPSZ_16_vex32_evex64 +#define Weh_x TYPE_W, OPSZ_half_16_vex32_evex64 /* my own codes * size m = 32 or 16 bit depending on addr size attribute
1
/* ********************************************************** * Copyright (c) 2011-2019 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
16,883
wrong code: should be `Wh_e`
DynamoRIO-dynamorio
c
@@ -582,10 +582,11 @@ static void makeLabelTag (vString *const label) static lineType getLineType (void) { - vString *label = vStringNew (); + static vString *label = NULL; int column = 0; lineType type = LTYPE_UNDETERMINED; + label = vStringNewOrClear (label); do /* read in first 6 "margin" characters */ ...
1
/* * Copyright (c) 1998-2003, Darren Hiebert * * This source code is released for free distribution under the terms of the * GNU General Public License version 2 or (at your option) any later version. * * This module contains functions for generating tags for Fortran language * files. */ /* * INCLUDE FILES...
1
14,426
This leads to a small "leak" (mostly theoretical only though), if we don't want it this could be created in `initialize()` and destroyed in `finalize()`.
universal-ctags-ctags
c
@@ -25,6 +25,8 @@ import ( ) const ( + // BuildIDOSEnv is the os env name to get build id + BuildIDOSEnv = "BUILD_ID" translateFailedPrefix = "TranslateFailed" privacyInfoReplacement = "[Privacy Info]" )
1
// Copyright 2018 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,405
BuildIDOSEnvVarName or similar, otherwise it sounds it's actually holding actual value of env var
GoogleCloudPlatform-compute-image-tools
go
@@ -103,7 +103,7 @@ class SparkReader: """ with self.app.app_context(): - + current_app.logger.info('Spark consumer has started!') while True: self.init_rabbitmq_connection() self.incoming_ch = utils.create_channel_to_consume(
1
import json import logging import time from flask import current_app import pika import sqlalchemy import ujson from listenbrainz import utils from listenbrainz.db import stats as db_stats from listenbrainz.db import user as db_user from listenbrainz.db.exceptions import DatabaseException from listenbrainz.spark.hand...
1
18,227
I like this standard "container has started" message. Should we have a "container exited because FOO" message as well?
metabrainz-listenbrainz-server
py
@@ -19,6 +19,8 @@ package org.openqa.grid.web; import com.google.common.collect.Maps; +import com.sun.org.glassfish.gmbal.ManagedObject; + import org.openqa.grid.internal.Registry; import org.openqa.grid.internal.utils.GridHubConfiguration; import org.openqa.grid.web.servlet.DisplayHelpServlet;
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,533
And again. The reason it's bad is that if someone uses a JDK not produced by Oracle they won't have this class.
SeleniumHQ-selenium
py
@@ -0,0 +1,19 @@ +const { useHandsontable } = require('./use-handsontable'); +const { getDependencies } = require('./dependencies'); +const { register } = require('./register'); + +if (module) { + module.exports = { + useHandsontable, + instanceRegister: register, + getDependencies, + applyToWindow: () => ...
1
1
18,106
We have Vue application at our disposal, and have examples container implemented as component. Shouldn't helpers be imported instead being global? Not the best practice in Vue app I guess
handsontable-handsontable
js
@@ -1221,3 +1221,14 @@ type NoMergedMDError struct { func (e NoMergedMDError) Error() string { return fmt.Sprintf("No MD yet for TLF %s", e.tlf) } + +// DiskCacheClosedError indicates that the disk cache has been +// closed, and thus isn't accepting any more operations. +type DiskCacheClosedError struct { + op stri...
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "fmt" "github.com/keybase/client/go/libkb" "github.com/keybase/client/go/protocol/keybase1" "github.com/keybase/kbfs/kbfsblock" "github.c...
1
15,707
No trailing punctuation in the error message.
keybase-kbfs
go
@@ -447,5 +447,6 @@ public class Notifier } } clip.start(); + clip.close(); } }
1
/* * Copyright (c) 2016-2017, Adam <Adam@sigterm.info> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * ...
1
16,388
tested? seems like it could break
open-osrs-runelite
java
@@ -77,9 +77,10 @@ public final class IndexUpgrader { public static void main(String[] args) throws IOException { parseArgs(args).upgrade(); } - + + /** Parse arguments. */ @SuppressForbidden(reason = "System.out required: command line tool") - static IndexUpgrader parseArgs(String[] args) throws IOEx...
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 may ...
1
37,841
This have to be public because the renamed o.a.l.backward_index.TestBackwardsCompatibility refers this.
apache-lucene-solr
java
@@ -286,7 +286,7 @@ func TestApplicationsUpgradeOverGossip(t *testing.T) { fixture.SetupNoStart(t, filepath.Join("nettemplates", "TwoNodes100SecondTestUnupgradedProtocol.json")) // for the primary node, we want to have a different consensus which always enables applications. - primaryNodeUnupgradedProtocol := con...
1
// Copyright (C) 2019-2021 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
41,624
unrelated to your change, but I don't think that this is correct anymore. We also seen to remove application support from `primaryNodeUnupgradedProtocol` for the test to be correct.
algorand-go-algorand
go
@@ -440,6 +440,19 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share cfg.Credentials = credentials.NewStaticCredentialsFromCreds( envCfg.Creds, ) + + } else if len(envCfg.WebIdentityTokenFilePath) > 0 { + // handles assume role via OIDC token. This should happen before a...
1
package session import ( "crypto/tls" "crypto/x509" "fmt" "io" "io/ioutil" "net/http" "os" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws...
1
9,389
Should this also validate that the RoleArn env var is provided, or just let the creds fail?
aws-aws-sdk-go
go
@@ -20,10 +20,12 @@ package transport +import "github.com/opentracing/opentracing-go" + // Deps is the interface of any object useful for passing injected // dependencies into inbound and outbound transports. type Deps interface { - // Tracer() opentracing.Tracer + Tracer() opentracing.Tracer } // NoDeps is...
1
// Copyright (c) 2016 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
10,074
fwiw, in tchannel-go I've implemented a similar method on TChannel that either returns a Tracer instance it was initialized with, or returns `opentracing.GlobalTracer()`, which by default happens to return a singleton instance of `NoopTracer`. In Go the use of global variables is not frowned upon as say in Java, so thi...
yarpc-yarpc-go
go
@@ -135,6 +135,10 @@ class SeriesTest(ReusedSQLTestCase, SQLTestUtils): self.assertEqual(kidx.name, "renamed") self.assert_eq(kidx, pidx) + expected_error_message = "Series.name must be a hashable type" + with self.assertRaisesRegex(TypeError, expected_error_message): + kser...
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,840
Shall we also add `ks.Series([1, 2, 3], name=["0", "1"])`?
databricks-koalas
py
@@ -45,7 +45,7 @@ public class PermissioningJsonRpcRequestFactory { Request<?, AddNodeResponse> addNodesToWhitelist(final List<URI> enodeList) { return new Request<>( - "perm_addNodesToWhitelist", + "perm_addNodesToAllowlist", Collections.singletonList(enodeList), web3jService,...
1
/* * Copyright ConsenSys AG. * * 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
22,896
Can this be updated?
hyperledger-besu
java
@@ -89,14 +89,7 @@ final class AddProviderCompilerPass implements CompilerPassInterface $definition = $container->getDefinition($id); foreach ($context['formats'] as $format => $formatConfig) { - $formatConfig['quality'] = $formatConfig['quality'] ?? 80; - ...
1
<?php declare(strict_types=1); /* * This file is part of the Sonata Project package. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\MediaBundle\Dependenc...
1
12,510
this change is to avoid duplication on the defaults. They are already on the Configuration class. (Also I removed the false default, because the admin format does not have it). This is also produces the rest of the diff, changes from false to null.
sonata-project-SonataMediaBundle
php
@@ -46,6 +46,8 @@ func (pc *podConfigurator) connectInterfaceToOVSAsync(ifConfig *interfacestore.I go func() { klog.Infof("Waiting for interface %s to be created", hostIfAlias) err := wait.PollImmediate(time.Second, 60*time.Second, func() (bool, error) { + containerAccess.lockContainer(containerID) + defer ...
1
// +build windows // Copyright 2021 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 applicabl...
1
33,029
What does it protect from? If it's subsequent CNI calls, won't containerID be different from the first one? or it's different in containerd? we use `getInfraContainer` to get the lock identity in CNIAdd. And this reminds me what if the first CNI call and the subquent ones run into connectInterfaceToOVSAsync, will dupli...
antrea-io-antrea
go
@@ -0,0 +1,19 @@ +<?php + +namespace Shopsys\FrameworkBundle\Model\Advert\Exception; + +use Exception; + +class AdvertPositionNotKnownException extends Exception implements AdvertException +{ + public function __construct(string $positionName, array $knownPositionsNames, Exception $previous = null) + { + $...
1
1
11,390
In Exceptions' constructors, we always add a optional last parameter `Exception $previous = null`. In the past, this was (still is?) a part of the coding standards.
shopsys-shopsys
php
@@ -90,6 +90,15 @@ const connectionActivityMonitorInterval = time.Minute * 3 // we discard the connection. const maxPeerInactivityDuration = time.Minute * 5 +// maxMessageQueueDuration is the maximum amount of time a message is allowed to be waiting +// in the various queues before being sent. Once that deadline ha...
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
35,195
I think more idiomatic (and consistent with elsewhere in our code base, and more natural to read as "25 seconds") is `25 * time.Second`
algorand-go-algorand
go
@@ -127,6 +127,7 @@ func NewDecoder(opts ...func(*Decoder)) *Decoder { d := &Decoder{ MarshalOptions: MarshalOptions{ SupportJSONTags: true, + SupportYAMLTags: true, }, } for _, o := range opts {
1
package dynamodbattribute import ( "encoding/base64" "fmt" "reflect" "strconv" "time" "github.com/aws/aws-sdk-go/service/dynamodb" ) // An Unmarshaler is an interface to provide custom unmarshaling of // AttributeValues. Use this to provide custom logic determining // how AttributeValues should be unmarshaled....
1
9,337
Enabling `YAML` by default would be a breaking change in behavior for some applications if the struct's used by that application already include YAML tags, but their application has been (un)marshaling DynamoDB Attributes based on the struct name.
aws-aws-sdk-go
go
@@ -131,7 +131,7 @@ public class DriverCommandExecutor extends HttpCommandExecutor implements Closea Thread.currentThread().interrupt(); throw new WebDriverException("Timed out waiting for driver server to stop.", e); } finally { - executorService.shutdownNow(); + executorService....
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
19,373
For the command executor, which in turn, uses the HTTP client to talk to the WebDriver, the client might have high-timeout values set, so the shutdown can take a long time if we wait for it to complete, especially if multiple-long running threads are there. I think it might be a good idea in general to couple the shutd...
SeleniumHQ-selenium
py
@@ -38,7 +38,7 @@ public abstract class HiveMetastoreTest { @BeforeClass public static void startMetastore() throws Exception { HiveMetastoreTest.metastore = new TestHiveMetastore(); - metastore.start(); + metastore.start(new HiveConf(HiveMetastoreTest.class)); HiveMetastoreTest.hiveConf = metasto...
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
32,289
Is this change needed? `start()` is still defined and uses `HiveMetastoreTest.class`. The only difference is that this doesn't pass a `Configuration` and the parameterless `start` passes `new Configuration()`.
apache-iceberg
java
@@ -27,6 +27,7 @@ type stakingCommand struct { stakingV1 Protocol stakingV2 *staking.Protocol candIndexer *CandidateIndexer + sr protocol.StateReader } // NewStakingCommand creates a staking command center to manage staking committee and new native staking
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,548
I think it is weird to store sr in protocol struct
iotexproject-iotex-core
go
@@ -7308,6 +7308,16 @@ NATable * NATableDB::get(const ExtendedQualName* key, BindWA* bindWA, NABoolean } } + // the reload cqd will be set during aqr after compiletime and runtime + // timestamp mismatch is detected. + // If set, reload hive metadata. + if ((cachedNATable->isHiveTable()) && + (CmpCo...
1
/********************************************************************** // @@@ START COPYRIGHT @@@ // // 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. ...
1
11,992
Will this cause a reload _all_ NATable information? It's too bad we don't have some way to limit the reload to just the tables that have a metadata mismatch.
apache-trafodion
cpp
@@ -111,6 +111,7 @@ var opDocList = []stringString{ {"app_global_del", "delete key A from a global state of the current application"}, {"asset_holding_get", "read from account specified by Txn.Accounts[A] and asset B holding field X (imm arg) => {0 or 1 (top), value}"}, {"asset_params_get", "read from asset Txn.F...
1
// Copyright (C) 2019-2021 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
41,691
'fail unless X is a non-zero number' it will also fail if X is a byte string
algorand-go-algorand
go
@@ -1447,10 +1447,13 @@ class ElementPlot(BokehPlot, GenericElementPlot): """ Resets RangeXY streams if norm option is set to framewise """ - if self.overlaid: + # Temporarily reverts this fix (see https://github.com/holoviz/holoviews/issues/4396) + # This fix caused Plot...
1
from __future__ import absolute_import, division, unicode_literals import sys import warnings from types import FunctionType import param import numpy as np import bokeh import bokeh.plotting from bokeh.core.properties import value from bokeh.document.events import ModelChangedEvent from bokeh.models import ( Co...
1
24,190
SyntaxError I think
holoviz-holoviews
py
@@ -5012,6 +5012,9 @@ TEST_F(VkLayerTest, ValidateGeometryNV) { vkCreateAccelerationStructureNV(m_device->handle(), &as_create_info, nullptr, &as); m_errorMonitor->VerifyFound(); } +#if 0 + // XXX Subtest disabled because this is the wrong VUID. + // No VUIDs currently exist to require memo...
1
/* * Copyright (c) 2015-2020 The Khronos Group Inc. * Copyright (c) 2015-2020 Valve Corporation * Copyright (c) 2015-2020 LunarG, Inc. * Copyright (c) 2015-2020 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Y...
1
12,764
I've filed an internal spec issue to add these missing VUs.
KhronosGroup-Vulkan-ValidationLayers
cpp
@@ -24,6 +24,7 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import java.io.IOException; +import java.io.UncheckedIOException; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.ArrayList;
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
19,388
Can you please revert changes to files in the `thoughtworks` package? This is legacy code and we will eventually phase out RC.
SeleniumHQ-selenium
java
@@ -24,16 +24,11 @@ import java.math.BigInteger; import java.nio.ByteBuffer; import java.time.Instant; import java.time.ZoneOffset; +import java.util.Arrays; import java.util.List; import java.util.Map; -import org.apache.flink.table.data.ArrayData; -import org.apache.flink.table.data.DecimalData; -import org.apac...
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
41,702
In iceberg, we usually don't use `*` to import package, it's more clear to import the specify package one by one.
apache-iceberg
java
@@ -19,6 +19,8 @@ package org.openqa.grid.web; import com.google.common.collect.Maps; +import com.sun.org.glassfish.gmbal.ManagedObject; + import org.openqa.grid.internal.Registry; import org.openqa.grid.internal.utils.GridHubConfiguration; import org.openqa.grid.web.servlet.DisplayHelpServlet;
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,533
And again. The reason it's bad is that if someone uses a JDK not produced by Oracle they won't have this class.
SeleniumHQ-selenium
js
@@ -18,7 +18,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure // There's no reason to stop timing the write after the connection is closed. var oneBufferSize = maxResponseBufferSize.Value; var maxBufferedBytes = oneBufferSize < long.MaxValue / 2 ? on...
1
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public static class TimeoutControlExtensions { public stat...
1
17,044
Since we now keep track of all bytes written, and extend the write timeout as needed, it's tempting to no longer add 2 times the max buffer size to the bytes written accounting for the connection drain timeout. As we've discussed before, this add several minutes to the timeout with the default 240 bytes/sec rate limit....
aspnet-KestrelHttpServer
.cs
@@ -0,0 +1,18 @@ +const formPropsSet = new Set([ + 'form', + 'formAction', + 'formEncType', + 'formMethod', + 'formNoValidate', + 'formTarget', +]); + +export default function getFormProps(props) { + return Object.keys(props).reduce((prev, key) => { + if (formPropsSet.has(key)) { + // eslint-disable-next-line no-par...
1
1
12,952
Good call. Makes we wonder if we should do this with the ARIA props.
salesforce-design-system-react
js
@@ -24,9 +24,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; +import java.sql.*; import java.text.ParseException; import java.util.ArrayList; im...
1
/* * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. Camunda licenses this file to you under the Apache License, * Version 2.0; y...
1
9,664
Please do not use wildcard imports.
camunda-camunda-bpm-platform
java
@@ -386,6 +386,7 @@ struct wlr_surface *wlr_surface_create(struct wl_resource *res, wl_resource_post_no_memory(res); return NULL; } + wlr_log(L_DEBUG, "New wlr_surface %p (res %p)", surface, res); surface->renderer = renderer; surface->texture = wlr_render_texture_create(renderer); surface->resource = res...
1
#include <assert.h> #include <stdlib.h> #include <wayland-server.h> #include <wlr/util/log.h> #include <wlr/egl.h> #include <wlr/render/interface.h> #include <wlr/types/wlr_surface.h> #include <wlr/render/matrix.h> static void surface_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destr...
1
7,850
Not sure about these added logs, as said in the commit message it's probably not something we want all the time, but it helped me debug a bit.
swaywm-wlroots
c
@@ -487,8 +487,6 @@ class Comparison(ComparisonInterface): paths2 = el2.split() if len(paths1) != len(paths2): raise cls.failureException("%s objects do not have a matching number of paths." % msg) - for p1, p2 in zip(paths1, paths2): - cls.compare_dataset(p1, p2, '%s da...
1
""" Helper classes for comparing the equality of two HoloViews objects. These classes are designed to integrate with unittest.TestCase (see the tests directory) while making equality testing easily accessible to the user. For instance, to test if two Matrix objects are equal you can use: Comparison.assertEqual(matri...
1
23,378
Should there be an equivalent check or is it ok to remove this comparison?
holoviz-holoviews
py
@@ -57,7 +57,7 @@ def run_migrations_online(): # this callback is used to prevent an auto-migration from being generated # when there are no changes to the schema - # reference: http://alembic.readthedocs.org/en/latest/cookbook.html + # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.htm...
1
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import logging # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config ...
1
15,634
sorry, why this change?
quiltdata-quilt
py
@@ -82,7 +82,7 @@ public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase { * * @throws Exception When analysis fails. */ - protected abstract NamedList doAnalysis(SolrQueryRequest req) throws Exception; + protected abstract NamedList<?> doAnalysis(SolrQueryRequest req) throws Exceptio...
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 may ...
1
34,269
I think best practice is to use `NamedList<Object>` as the return type, and `NamedList<?>` as the argument type in methods, but I can't find a reference for it right now.
apache-lucene-solr
java
@@ -23,7 +23,9 @@ use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Coupon\Type\CouponInterface; +use Thelia\Model\Base\CouponModule; use Thelia\Model\Coupon as MCoupon; +use Thelia\Model...
1
<?php /*************************************************************************************/ /* This file is part of the Thelia package. */ /* */ /* Copyright (c) OpenStudio ...
1
10,091
Be careful, the base model is imported here !
thelia-thelia
php
@@ -60,7 +60,7 @@ func RootCommand() (*cobra.Command, *Flags) { rootCmd.PersistentFlags().IntVar(&cfg.HttpPort, "http.port", node.DefaultHTTPPort, "HTTP-RPC server listening port") rootCmd.PersistentFlags().StringSliceVar(&cfg.HttpCORSDomain, "http.corsdomain", []string{}, "Comma separated list of domains from whic...
1
package cli import ( "context" "fmt" "net/http" "time" "github.com/ledgerwatch/turbo-geth/cmd/utils" "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/internal/debug" "github.com/ledgerwatch/turbo-geth/log" "github.com/ledgerwatch/turbo-geth/node" "github.com/ledgerwatch/turbo-get...
1
21,860
Do we want to make this part of the default? Probably not. In fact, the default should probably be eth, web3 and net (which are the standard namespaces on other nodes).
ledgerwatch-erigon
go
@@ -1,4 +1,8 @@ class Clump < ActiveRecord::Base belongs_to :code_set belongs_to :slave + + def path + slave.path_from_code_set_id(code_set_id) + end end
1
class Clump < ActiveRecord::Base belongs_to :code_set belongs_to :slave end
1
8,314
What is the plan when we deploy the Crawler VM project and eliminate the Clump model?
blackducksoftware-ohloh-ui
rb
@@ -28,10 +28,6 @@ type MultiClusterConfig struct { metav1.TypeMeta `json:",inline"` // ControllerManagerConfigurationSpec returns the contfigurations for controllers config.ControllerManagerConfigurationSpec `json:",inline"` - // Leader is a role of ClusterSet member cluster - Leader bool `json:"leader,omitempty...
1
/* Copyright 2021 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 in writing, software...
1
49,496
these two are customized config fields, if we don't need them any more, we probably can use default ControllerManagerConfiguration
antrea-io-antrea
go
@@ -39,7 +39,12 @@ var ( defaultExecutablePathProvider executablePathProvider = os.Executable defaultCommandArgsProvider commandArgsProvider = func() []string { return os.Args } defaultOwnerProvider ownerProvider = user.Current - defaultRuntimeNameProvider runtimeNameProvider = func(...
1
// 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/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
1
17,430
I don't think we should be pulling the runtime name from the Compiler. There are two compiler frontends, but both of them compile the same source to generate the "go" runtime. I think until there is a request from an alternative implementation (the embedded world **might** have a different runtime), it's fine to hardco...
open-telemetry-opentelemetry-go
go
@@ -932,6 +932,10 @@ Model.find = function find (conditions, fields, options, callback) { options = null; } + if (this.schema.discriminatorMapping && fields) { + fields = fields + ' ' + this.schema.options.discriminatorKey; + } + // get the raw mongodb collection object var mq = new Query({}, optio...
1
/*! * Module dependencies. */ var Document = require('./document') , MongooseArray = require('./types/array') , MongooseBuffer = require('./types/buffer') , MongooseError = require('./error') , VersionError = MongooseError.VersionError , DivergentArrayError = MongooseError.DivergentArrayError , Query = r...
1
12,302
fields may be an object.
Automattic-mongoose
js
@@ -4,12 +4,12 @@ import ( "bufio" "encoding/json" "fmt" - "io/ioutil" "log" "net/http" "net/url" "strings" "sync" + "time" "github.com/hashicorp/hcl" "github.com/spiffe/spire/proto/agent/workloadattestor"
1
package k8s import ( "bufio" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "net/url" "strings" "sync" "github.com/hashicorp/hcl" "github.com/spiffe/spire/proto/agent/workloadattestor" "github.com/spiffe/spire/proto/common" spi "github.com/spiffe/spire/proto/common/plugin" ) type k8sPlugin struct { ...
1
9,372
i'm not confident these are the right defaults... anybody have input?
spiffe-spire
go
@@ -80,7 +80,7 @@ type CasPool struct { Namespace string // DiskList is the list of disks over which a storagepool will be provisioned - DiskList []string + DiskList []DiskGroup // PoolType is the type of pool to be provisioned e.g. striped or mirrored PoolType string
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, sof...
1
13,890
DiskGroupList can be better name
openebs-maya
go
@@ -229,7 +229,7 @@ func customErrorHandler(ctx context.Context, mux *runtime.ServeMux, m runtime.Ma runtime.DefaultHTTPErrorHandler(ctx, mux, m, w, req, err) } -func New(unaryInterceptors []grpc.UnaryServerInterceptor, assets http.FileSystem, gatewayCfg *gatewayv1.GatewayOptions) (*Mux, error) { +func New(unaryIn...
1
package mux import ( "context" "fmt" "io" "net/http" "net/http/httptest" "net/http/pprof" "net/textproto" "net/url" "path" "regexp" "strconv" "strings" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" "google.golang.org...
1
11,523
nit: lets leave gateway options at the end of the func signature.
lyft-clutch
go
@@ -527,7 +527,7 @@ public class PDKClient { SharedPreferences sharedPref = _context.getSharedPreferences(PDK_SHARED_PREF_FILE_KEY, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(PDK_SHARED_PREF_TOKEN_KEY, accessToken); - editor.commit(); +...
1
package com.pinterest.android.pdk; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.graphics.Bitmap; import android.net.Uri; impor...
1
12,310
It will be better to use `commit()` on a separate thread, apart from the UI thread. The reason is `commit()` is synchronous while `apply()` is asynchronous. So in case it might not perform actions immediately as expected.
fossasia-phimpme-android
java
@@ -123,10 +123,10 @@ func (q *queryImpl) validateTerminationState( queryResult := terminationState.queryResult validAnswered := queryResult.GetResultType().Equals(shared.QueryResultTypeAnswered) && queryResult.Answer != nil && - queryResult.ErrorMessage == nil + (queryResult.ErrorMessage == nil || *query...
1
// The MIT License (MIT) // // Copyright (c) 2019 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 //...
1
9,138
Took me almost 4 hours to find this.
temporalio-temporal
go
@@ -8,9 +8,9 @@ from .concat_dataset import ConcatDataset from .repeat_dataset import RepeatDataset from .extra_aug import ExtraAugmentation + __all__ = [ 'CustomDataset', 'XMLDataset', 'CocoDataset', 'VOCDataset', 'GroupSampler', 'DistributedGroupSampler', 'build_dataloader', 'to_tensor', 'random_scale'...
1
from .custom import CustomDataset from .xml_style import XMLDataset from .coco import CocoDataset from .voc import VOCDataset from .loader import GroupSampler, DistributedGroupSampler, build_dataloader from .utils import to_tensor, random_scale, show_ann, get_dataset from .concat_dataset import ConcatDataset from .repe...
1
17,412
There should be only a single blank line between imports and `__all__`.
open-mmlab-mmdetection
py
@@ -194,7 +194,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase { SolrDocumentList docs = assertSearch(params("q", "*:*", "rows", "10", "fl",fl)); // shouldn't matter what doc we pick... for (SolrDocument doc : docs) { - assertEquals(fl + " => " + doc, 4, doc.size()); ...
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 may ...
1
28,010
Doc size increased by 1 since _root_ is also returned by queries.
apache-lucene-solr
java
@@ -822,8 +822,14 @@ def color_intervals(colors, levels, clip=None, N=255): clmin, clmax = clip lidx = int(round(N*((clmin-cmin)/interval))) uidx = int(round(N*((cmax-clmax)/interval))) - cmap = cmap[lidx:N-uidx] - return cmap + uidx = N-uidx + if lidx == uidx: + ...
1
from __future__ import unicode_literals, absolute_import, division from collections import defaultdict, namedtuple import traceback import warnings import bisect import numpy as np import param from ..core import (HoloMap, DynamicMap, CompositeOverlay, Layout, Overlay, GridSpace, NdLayout, Store...
1
21,545
Now the return value has changed (or at least now includes `clip`) it might be worth updating the docstring...
holoviz-holoviews
py
@@ -411,7 +411,7 @@ func TestRollDPoSConsensus(t *testing.T) { require.NoError(t, err) require.NoError(t, sf.Start(ctx)) for j := 0; j < numNodes; j++ { - ws, err := sf.NewWorkingSet() + ws, err := sf.NewWorkingSet(nil) require.NoError(t, err) _, err = accountutil.LoadOrCreateAccount(ws, cha...
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
19,845
shadow: declaration of "err" shadows declaration at line 410 (from `govet`)
iotexproject-iotex-core
go
@@ -82,7 +82,13 @@ class Flashmessages extends AbstractHelper $this->fm->getMessages($ns), $this->fm->getCurrentMessages($ns) ); foreach (array_unique($messages, SORT_REGULAR) as $msg) { - $html .= '<div class="' . $this->getClassForNamespace($ns) . '">'; + ...
1
<?php /** * Flash message view helper * * PHP version 5 * * Copyright (C) Villanova University 2010. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. * * This program is d...
1
24,818
Should we be escaping $attr and/or $value here? Seems like htmlspecialchars() might be in order to be on the safe side.
vufind-org-vufind
php
@@ -40,6 +40,7 @@ module Travis def clone_args args = "--depth=#{depth}" args << " --branch=#{branch}" unless data.ref + args << " #{quiet_o}" args end
1
require 'shellwords' module Travis module Build class Git class Clone < Struct.new(:sh, :data) def apply sh.fold 'git.checkout' do clone_or_fetch sh.cd dir fetch_ref if fetch_ref? checkout end end private ...
1
12,702
why not remove the need for the `quiet_o` method and just add it similar to how the `--branch` is added? also, looks like the indenting is a little off
travis-ci-travis-build
rb
@@ -96,8 +96,9 @@ public class FlowContainer { private static final String CONF_DIR = "conf"; private static final String JOB_THREAD_COUNT = "flow.num.job.threads"; private static final String DEFAULT_LOG_CHUNK_SIZE = "5MB"; + private static final String FLOW_EXECUTION_ID = "FLOW_EXECUTION_ID"; + private sta...
1
/* * Copyright 2020 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
21,191
These variables are already created in constants. Please reuse those.
azkaban-azkaban
java
@@ -156,6 +156,10 @@ class Key(object): if self.resp == None: self.mode = 'r' + if self.version_id: + query_args = query_args or [] + query_args.append('versionId=%s' % self.version_id) + provider = self.bucket.connection.provider ...
1
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems 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 # witho...
1
8,036
query_args is a string, not a list. Therefore you cannot call append to it. Also, line 986-989 of key.py already have code that is appending the versionId query parameter.
boto-boto
py
@@ -548,12 +548,12 @@ func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *api.Fil if info != nil { err := o.decodeMetaData(info) if err != nil { - return nil, err + return o, err } } else { err := o.readMetaData(ctx) // reads info and headers, returning an error if err != nil...
1
// Package b2 provides an interface to the Backblaze B2 object storage system package b2 // FIXME should we remove sha1 checks from here as rclone now supports // checking SHA1s? import ( "bufio" "bytes" "context" "crypto/sha1" "fmt" gohash "hash" "io" "net/http" "path" "regexp" "strconv" "strings" "sync...
1
8,992
I think this change and the one below will break the integration tests which expect a `nil` object if `NewObject` fails.
rclone-rclone
go
@@ -1,6 +1,7 @@ # frozen_string_literal: true require 'hocon' +require 'bolt/error' class TransportConfig attr_accessor :host, :port, :ssl_cert, :ssl_key, :ssl_ca_cert, :ssl_cipher_suites,
1
# frozen_string_literal: true require 'hocon' class TransportConfig attr_accessor :host, :port, :ssl_cert, :ssl_key, :ssl_ca_cert, :ssl_cipher_suites, :loglevel, :logfile, :whitelist, :concurrency def initialize(global = nil, local = nil) @host = '127.0.0.1' @port = 62658 @ssl_cert = ...
1
9,745
Looks like this isn't used in this file?
puppetlabs-bolt
rb
@@ -327,7 +327,10 @@ class PandasLikeSeries(_Frame): sum = df_dropna._spark_count() df = df._spark_withColumn('count', F._spark_col('count') / F._spark_lit(sum)) - return _col(df.set_index([self.name])) + hidden_name = 'index' if self.name != 'index' else 'level_0' + df....
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,234
why hidden name? How about `index_name`?
databricks-koalas
py
@@ -367,6 +367,9 @@ ExWorkProcRetcode ExHdfsScanTcb::work() char cursorId[8]; HdfsFileInfo *hdfo = NULL; Lng32 openType = 0; + int hiveScanMode = 0; + + hiveScanMode = CmpCommon::getDefaultLong(HIVE_SCAN_SPECIAL_MODE); while (!qparent_.down->isEmpty()) {
1
// ********************************************************************** // @@@ START COPYRIGHT @@@ // // 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....
1
11,085
Usually, CQDs are not accessed directly in executor operators directly. It should be passed as a flag in the TDB. It is possible that the query is compiled in a different process, then this CQD setting won't be available in the executor layer.
apache-trafodion
cpp
@@ -477,9 +477,9 @@ func ShardID(shardID int32) ZapTag { return NewInt32("shard-id", shardID) } -// ShardItem returns tag for ShardItem -func ShardItem(shardItem interface{}) ZapTag { - return NewAnyTag("shard-item", shardItem) +// ShardContext returns tag for shard.Context +func ShardContext(shard interface{}) Za...
1
// The MIT License // // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 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 Soft...
1
13,015
This tag was broken, the value write to log was the memory address. Please verify that this actually write out meaningful content in log.
temporalio-temporal
go
@@ -0,0 +1,9 @@ +"""Checks import position rule with pep-0008""" +# pylint: disable=unused-import,relative-import,ungrouped-imports,import-error,no-name-in-module,relative-beyond-top-level,undefined-variable + +__author__ = 'some author' +__email__ = 'some.author@some_email' +__copyright__ = 'Some copyright' + + +impor...
1
1
8,522
Why do you have to disable all of these checks?
PyCQA-pylint
py
@@ -1639,6 +1639,7 @@ class CommandDispatcher: """ try: elem.set_value(text) + mainwindow.raise_window(objreg.last_focused_window()) except webelem.OrphanedError as e: message.error('Edited element vanished') except webelem.Error as e:
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
20,201
Just a note to myself: After merging this, I should edit the line after this one to use `message.error`, as raising a `CommandError` from here seems wrong!
qutebrowser-qutebrowser
py
@@ -1010,8 +1010,6 @@ GLOBAL_LABEL(FUNCNAME:) mov TEST_REG2_ASM, 1 /* xax statelessly restored here. */ mov TEST_REG2_ASM, 2 - /* xax is dead, so initial aflags spill should not use slot. */ - mov REG_XAX, 0 jmp test28_done test28_done: ...
1
/* ********************************************************** * Copyright (c) 2015-2021 Google, Inc. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following ...
1
25,207
In this test, we want xax to be dead, so that aflags are not spilled to a slot.
DynamoRIO-dynamorio
c
@@ -54,7 +54,9 @@ type Options struct { func newOptions() *Options { return &Options{ - config: new(AgentConfig), + config: &AgentConfig{ + EnablePrometheusMetrics: true, + }, } }
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
28,539
I remember there were some misleading code about this but forgot to correct them. Although we initialize `config` here, it was discarded in `complete`, so I guess setting the default value here doesn't take effect. We should change L139-L140 as well to use the initialized `config`. So do antrea-controller.
antrea-io-antrea
go
@@ -364,4 +364,13 @@ describe RSpec::Core::Formatters::BaseTextFormatter do output.string.should =~ /, 100.0% of total time\):/ end end + + describe "custom_colors" do + before { RSpec.configuration.stub(:color_enabled?) { true } } + it "uses the custom success color" do + RSpec.configurati...
1
require 'spec_helper' require 'rspec/core/formatters/base_text_formatter' describe RSpec::Core::Formatters::BaseTextFormatter do let(:output) { StringIO.new } let(:formatter) { RSpec::Core::Formatters::BaseTextFormatter.new(output) } describe "#summary_line" do it "with 0s outputs pluralized (excluding pend...
1
8,207
Stubbin a value object (like `RSpec.configuration`) is a bit of a code smell, I think. You can just set `color_enabled` and `success_color` through the configuration APIs provided by `RSpec::Configuration` -- no need to stub. The `sandboxed` thing in `spec_helper.rb` takes care of preventing changes to the configuratio...
rspec-rspec-core
rb
@@ -624,9 +624,14 @@ API.prototype.getBalanceFromPrivateKey = function(privateKey, coin, cb) { var B = Bitcore_[coin]; var privateKey = new B.PrivateKey(privateKey); - var address = privateKey.publicKey.toAddress(); + + var address = privateKey.publicKey.toAddress().toString(); + if (coin == 'bch') { + a...
1
'use strict'; var _ = require('lodash'); var $ = require('preconditions').singleton(); var util = require('util'); var async = require('async'); var events = require('events'); var Bitcore = require('bitcore-lib'); var Bitcore_ = { btc: Bitcore, bch: require('bitcore-lib-cash'), }; var Mnemonic = require('bitcore-...
1
15,218
you can use `toString(true)` that will work for BTC and remove the prefix for BCH.
bitpay-bitcore
js
@@ -652,9 +652,10 @@ class TabbedBrowser(tabwidget.TabWidget): log.modes.debug("Current tab changed, focusing {!r}".format(tab)) tab.setFocus() - for mode in [usertypes.KeyMode.hint, usertypes.KeyMode.insert, - usertypes.KeyMode.caret, usertypes.KeyMode.passthrough]: - ...
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,772
This line is too long now - please break it after the comma.
qutebrowser-qutebrowser
py
@@ -67,6 +67,7 @@ type StreamerDisconnecter interface { type Stream interface { io.ReadWriter io.Closer + ResponseHeaders() Headers Headers() Headers FullClose() error Reset() error
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 p2p provides the peer-to-peer abstractions used // across different protocols in Bee. package p2p import ( "context" "io" "time" "github.com...
1
13,526
I find this addition to the interface a bit contentious. I think it would be cleaner to just return the response headers together with the new stream on `NewStream`. I.e. change the method signature for `NewStream` to be: `NewStream(ctx context.Context, overlay swarm.Address, headers p2p.Headers, protocolName, protocol...
ethersphere-bee
go
@@ -222,6 +222,12 @@ class CartFacade if ($cart !== null) { $this->cartWatcherFacade->checkCartModifications($cart); + + if ($cart->isEmpty()) { + $this->deleteCart($cart); + + return null; + } } return $cart;
1
<?php namespace Shopsys\FrameworkBundle\Model\Cart; use Doctrine\ORM\EntityManagerInterface; use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Model\Cart\Item\CartItemFactoryInterface; use Shopsys\FrameworkBundle\Model\Cart\Watcher\CartWatcherFacade; use Shopsys\FrameworkBundle\Model\Cu...
1
14,775
i hope there is some magic where isEmpty or some cron can strip all non listable products from cart, but since we have the situation tested it should be OK and also we'll see during tests
shopsys-shopsys
php
@@ -127,7 +127,7 @@ public class HiveIcebergFilterFactory { case FLOAT: return leaf.getLiteral(); case DATE: - return daysFromTimestamp((Timestamp) leaf.getLiteral()); + return daysFromDate((Date) leaf.getLiteral()); case TIMESTAMP: return microsFromTimestamp((Timest...
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,495
I think we should check the type returned by `getLiteral` and handle that here. Then we won't need separate code for different versions.
apache-iceberg
java
@@ -131,13 +131,13 @@ func (s *HandlerTestSuite) TestFetchX509SVID() { func (s *HandlerTestSuite) TestSendResponse() { emptyUpdate := new(cache.WorkloadUpdate) s.stream.EXPECT().Send(gomock.Any()).Times(0) - err := s.h.sendResponse(emptyUpdate, s.stream) + err := s.h.sendX509SVIDResponse(emptyUpdate, s.stream) s...
1
package workload import ( "context" "crypto/x509" "errors" "testing" "time" "github.com/golang/mock/gomock" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/suite" "github.com/spiffe/spire/pkg/agent/auth" "github.com/spiffe/spire/pkg/agent/manager/cache" "github.com/spiffe/spire/pkg/co...
1
10,029
Tests for JWT handler functionality?
spiffe-spire
go
@@ -548,9 +548,6 @@ namespace Microsoft.AspNetCore.Server.KestrelTests "POST / HTTP/1.1", "Content-Length: 3", "", - "101POST / HTTP/1.1", - "Content-Length: 3", - "", ...
1
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Sockets; using System.Text; using System.Threading;...
1
10,251
It's weird to set a 101 response and complete without writing anything, but this is still a valid test case right?
aspnet-KestrelHttpServer
.cs
@@ -207,6 +207,19 @@ class DefaultBucketViewTest(FormattedErrorMixin, BaseWebTest, self.assertEqual(resp.body, response.body) +class HelloViewTest(BaseWebTest, unittest.TestCase): + + def test_returns_bucket_id_and_url_if_authenticated(self): + response = self.app.get('/', headers=self.header...
1
import mock from six import text_type from uuid import UUID from pyramid.httpexceptions import HTTPBadRequest from cliquet.errors import ERRORS, http_error from cliquet.storage import exceptions as storage_exceptions from cliquet.tests.support import FormattedErrorMixin from cliquet.utils import hmac_digest from kin...
1
8,942
Should we move that information in the capability itself?
Kinto-kinto
py
@@ -18,6 +18,9 @@ class StatisticsElement(Chart): __abstract = True + # Ensure Interface does not add an index + _auto_indexable_1d = False + def __init__(self, data, kdims=None, vdims=None, **params): if isinstance(data, Element): params.update(get_param_values(data))
1
import param import numpy as np from ..core.dimension import Dimension, process_dimensions from ..core.data import Dataset from ..core.element import Element, Element2D from ..core.util import get_param_values, OrderedDict from .chart import Chart, BoxWhisker class StatisticsElement(Chart): """ StatisticsEle...
1
20,083
Is this needed?
holoviz-holoviews
py
@@ -163,7 +163,7 @@ func (r *ReconcileRemoteClusterIngress) Reconcile(request reconcile.Request) (re // can't proceed if the secret(s) referred to doesn't exist certBundleSecrets, err := r.getIngressSecrets(rContext) if err != nil { - rContext.logger.WithError(err).Error("will need to retry until able to find al...
1
package remoteingress import ( "bytes" "context" "crypto/md5" "fmt" "reflect" "sort" "time" log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "...
1
7,344
This log should not be an error as it communicates that we need to retry till we get the cert information for remote ingress controller.
openshift-hive
go
@@ -130,6 +130,8 @@ namespace Nethermind.Blockchain BlockHeader[] FindHeaders(Keccak hash, int numberOfBlocks, int skip, bool reverse); void DeleteInvalidBlock(Block invalidBlock); + + void Flush(); event EventHandler<BlockEventArgs> NewBestSuggestedBlock; ...
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
23,460
BlockTree alredy has a polluted API, this one seems very internal
NethermindEth-nethermind
.cs
@@ -123,6 +123,7 @@ describe "BoltSpec::Run", ssh: true do describe 'apply_manifest' do it 'should apply a manifest file' do + bolt_inventory['features'] = ['puppet-agent'] with_tempfile_containing('manifest', "notify { 'hello world': }", '.pp') do |manifest| results = apply_man...
1
# frozen_string_literal: true require 'spec_helper' require 'bolt_spec/conn' require 'bolt_spec/run' require 'bolt_spec/files' # In order to speed up tests there are only ssh versions of these specs # While the target shouldn't matter this does mean this helper is not tested on # windows controllers. describe "BoltSp...
1
13,620
Sorry, I realize my line numbers were probably off after you deleted your variables! I meant for this to go in the `before(:all) do` and `after(:all) do` blocks.
puppetlabs-bolt
rb
@@ -195,7 +195,9 @@ public class ToParentBlockJoinQuery extends Query { return null; } } - return MatchesUtils.MATCH_WITH_NO_TERMS; + + // TODO: which fields should be here? + return MatchesUtils.matchWithNoTerms(getQuery()); } }
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 may ...
1
35,832
This bit I wasn't really sure about.
apache-lucene-solr
java
@@ -87,6 +87,7 @@ function buildRules(grunt, options, commons, callback) { var tags = options.tags ? options.tags.split(/\s*,\s*/) : []; var rules = result.rules; var checks = result.checks; + parseChecks(checks); // Translate checks if (locale && locale.checks) {
1
/*eslint-env node */ /*eslint max-len: off */ 'use strict'; var clone = require('clone'); var dot = require('@deque/dot'); var templates = require('./templates'); var buildManual = require('./build-manual'); var entities = new (require('html-entities').AllHtmlEntities)(); var packageJSON = require('../package.json'); ...
1
15,884
From the code, a check's metatdata was only added to `axe._load` if a rule used it. Since `role-none` and `role-presentation` were no longer used in any rule, their metadata was never added. This caused any translation file that passed translations for those checks to fail `axe.configure` with > "Locale provided for un...
dequelabs-axe-core
js
@@ -740,7 +740,7 @@ class Package: gc.enable() return pkg - def set_dir(self, lkey, path=None, meta=None): + def set_dir(self, lkey, path=None, meta=None, update_policy="incoming"): """ Adds all files from `path` to the package.
1
import inspect from collections import deque import gc import hashlib import io import json import pathlib import os import shutil import time from multiprocessing import Pool import uuid import warnings import jsonlines from tqdm import tqdm from .backends import get_package_registry from .data_transfer import ( ...
1
18,743
We should raise `ValueError` if `update_policy not in ['existing', 'incoming']`. (or `in Enum.__members__` or however we want to express legal values)
quiltdata-quilt
py
@@ -42,10 +42,11 @@ namespace MvvmCross.iOS.Platform _applicationDelegate = applicationDelegate; } - protected MvxIosSetup(IMvxApplicationDelegate applicationDelegate, IMvxIosViewPresenter presenter) + protected MvxIosSetup(IMvxApplicationDelegate applicationDelegate, UIWindow wind...
1
// MvxIosSetup.cs // MvvmCross is licensed using Microsoft Public License (Ms-PL) // Contributions and inspirations noted in readme.md and license.txt // // Project Lead - Stuart Lodge, @slodge, me@slodge.com using System; using System.Collections.Generic; using System.Reflection; using MvvmCross.Binding; using MvvmC...
1
12,963
`_applicationDelegate` and `_window` are already set in the call for `: this (applicationDelegate, window)`, no need to assigning them again here
MvvmCross-MvvmCross
.cs
@@ -9,7 +9,7 @@ export function createContext(defaultValue) { _id: '__cC' + i++, _defaultValue: defaultValue, Consumer(props, context) { - return props.children(context); + return props.children(props.selector(context)); }, Provider(props) { if (!this.getChildContext) {
1
import { enqueueRender } from './component'; export let i = 0; export function createContext(defaultValue) { const ctx = {}; const context = { _id: '__cC' + i++, _defaultValue: defaultValue, Consumer(props, context) { return props.children(context); }, Provider(props) { if (!this.getChildContext) {...
1
15,521
We might not have a selector prop in the consumer
preactjs-preact
js
@@ -386,7 +386,7 @@ namespace Nethermind.Blockchain.Processing break; } - bool isFastSyncTransition = _blockTree.Head?.Header == _blockTree.Genesis && toBeProcessed.Number > 1; + bool isFastSyncTransition = (_blockTree.Head?.IsGenesis ?? false) && to...
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
23,752
IMO == true is more readable than ?? false
NethermindEth-nethermind
.cs
@@ -3,7 +3,7 @@ const test = require('./shared').assert, setupDatabase = require('./shared').setupDatabase, Script = require('vm'), expect = require('chai').expect, - normalizedFunctionString = require('bson/lib/bson/parser/utils').normalizedFunctionString, + normalizedFunctionString = require('bson/lib/pars...
1
'use strict'; const test = require('./shared').assert, setupDatabase = require('./shared').setupDatabase, Script = require('vm'), expect = require('chai').expect, normalizedFunctionString = require('bson/lib/bson/parser/utils').normalizedFunctionString, Buffer = require('safe-buffer').Buffer; const { Long,...
1
17,014
feel free when editing sections like this to introduce modern features like object destructuring.
mongodb-node-mongodb-native
js
@@ -1,3 +1,4 @@ +# coding: utf-8 # Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2012-2014 Google, Inc. # Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
1
# Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2012-2014 Google, Inc. # Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2015 Dmitry Pribysh <dmand@yandex.ru> # Copyright (c) 2015 Noam Yorav-Raphael <noamraph@gmail.com> # Copyright (c) 2015 Cezar ...
1
9,703
I think the correct pragma is `# -*- coding: utf-8 -*-
PyCQA-pylint
py
@@ -58,6 +58,9 @@ from scapy.layers.inet import TCP from scapy.packet import Raw from scapy.packet import Packet, bind_layers +from . import iec104, iec104_fields, iec104_information_elements, \ + iec104_information_objects # noqa: F401 + IEC_104_IANA_PORT = 2404 # direction - from the central station to th...
1
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Thomas Tannhaeuser <hecke@naberius.de> # This program is published under a GPLv2 license # # scapy.contrib.description = IEC-60870-5-104 APCI / APDU layer definitions # scapy.contrib.status = loads """ IEC ...
1
16,067
This fixes some import errors, due to the fact that this file has the same name than its module.
secdev-scapy
py
@@ -21,8 +21,9 @@ type Folder struct { fs *FS list *FolderList - handleMu sync.RWMutex - h *libkbfs.TlfHandle + handleMu sync.RWMutex + h *libkbfs.TlfHandle + hPreferredName string folderBranchMu sync.Mutex folderBranch libkbfs.FolderBranch
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libdokan import ( "fmt" "strings" "sync" "time" "github.com/keybase/kbfs/dokan" "github.com/keybase/kbfs/libfs" "github.com/keybase/kbfs/libkbfs" "gola...
1
13,747
I think we need to clear this out on logout, and update it on login, right?
keybase-kbfs
go
@@ -43,6 +43,8 @@ gboolean ot_util_filename_validate (const char *name, GError **error) { + if (name == NULL) + return glnx_throw (error, "Invalid NULL filename"); if (strcmp (name, ".") == 0) return glnx_throw (error, "Invalid self-referential filename '.'"); if (strcmp ...
1
/* * Copyright (C) 2011 Colin Walters <walters@verbum.org> * * SPDX-License-Identifier: LGPL-2.0+ * * This 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 2 of the Licen...
1
16,766
I think normally we'd make this a precondition (using e.g. `g_return_val_if_fail`), but meh, this works too!
ostreedev-ostree
c
@@ -34,5 +34,5 @@ public final class Const { public static final String SRC_MICROSERVICE = "x-cse-src-microservice"; - public static final String DEST_MICROSERVICE = "x-cse-dest-microservice"; + public static final String TARGET_MICROSERVICE = "x-cse-target-microservice"; }
1
/* * Copyright 2017 Huawei Technologies Co., Ltd * * 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 l...
1
6,537
Is this header used by other outside service?
apache-servicecomb-java-chassis
java
@@ -89,10 +89,3 @@ class TestZipFolder(BZTestCase): result_tree = set(filename[len(destination):] for filename in get_files_recursive(destination)) original_tree = set(filename[len(source):] for filename in get_files_recursive(source)) self.assertEqual(result_tree, original_tree) - - def t...
1
import json import os import zipfile from bzt.engine import Service, Provisioning from bzt.modules.blazemeter import CloudProvisioning, BlazeMeterClientEmul from bzt.modules.services import Unpacker from bzt.utils import get_files_recursive from tests import BZTestCase, __dir__ from tests.mocks import EngineEmul cla...
1
14,000
that's fine by me to have simple test for provisioning check
Blazemeter-taurus
py
@@ -83,7 +83,7 @@ public class TriggerBasedScheduleLoader implements ScheduleLoader { ConditionChecker checker = new BasicTimeChecker("BasicTimeChecker_1", s.getFirstSchedTime(), s.getTimezone(), s.isRecurring(), s.skipPastOccurrences(), - s.getPeriod()); + s.getPeriod()...
1
/* * Copyright 2014 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
11,370
These two methods seem to be identical except the names. Any idea why two methods are needed?
azkaban-azkaban
java
@@ -0,0 +1,14 @@ +#!/usr/bin/env python + + +import sys +import os +sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")) +from influxdb import InfluxDBClient +import config + +try: + i = InfluxDBClient(host=config.INFLUX_HOST, port=config.INFLUX_PORT, database=config.INFLUX_TEST_DB)...
1
1
14,019
I don't see much difference between this and `create_db` module. How about having a function with a `database` argument?
metabrainz-listenbrainz-server
py
@@ -183,7 +183,7 @@ class AnalyticsDashboardWidget extends Component { </div> { /* Data issue: on error display a notification. On missing data: display a CTA. */ } { ! receivingData && ( - error ? getDataErrorComponent( _x( 'Analytics', 'Service name', 'google-site-kit' ), error, true, t...
1
/** * AnalyticsDashboardWidget component. * * Site Kit by Google, Copyright 2019 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/LI...
1
31,919
See above, no need to pass the module name.
google-site-kit-wp
js
@@ -316,7 +316,7 @@ class LGBMModel(_LGBMModelBase): group : array-like or None, optional (default=None) Group data of training data. eval_set : list or None, optional (default=None) - A list of (X, y) tuple pairs to use as a validation sets. + A list of (X, y) tuple...
1
# coding: utf-8 # pylint: disable = invalid-name, W0105, C0111, C0301 """Scikit-Learn Wrapper interface for LightGBM.""" from __future__ import absolute_import import numpy as np import warnings from .basic import Dataset, LightGBMError from .compat import (SKLEARN_INSTALLED, _LGBMClassifierBase, ...
1
19,227
LightGBM supports multiple validation sets, so please leave `sets`.
microsoft-LightGBM
cpp