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
@@ -8,6 +8,7 @@ package blockchain import ( "context" + "github.com/iotexproject/iotex-address/address" "io/ioutil" "math/big" "os"
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
18,864
let's group imports in the order: std third party first party
iotexproject-iotex-core
go
@@ -1062,7 +1062,7 @@ public class JdbcExecutorLoaderTest { return new JdbcExecutorLoader(props, new CommonMetrics(new MetricsManager(new MetricRegistry())), null , null, null, null, null, - null, null); + null, null, null); } private boolean isTestSetup() {
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
14,543
So the tests run only when the db exists? Else everything passes?
azkaban-azkaban
java
@@ -0,0 +1,12 @@ +package bytesink + +import "io" + +// ByteSink represents a location to which bytes can be written. The ByteSink +// should be closed after all bytes have been written. +type ByteSink interface { + io.Writer + io.Closer + Open() error + ID() string +}
1
1
18,324
`Remove` is unclear. It seems the point is to allow the `FifoByteSink` to delete the underlying file. There seems to be an implicit contract that consumers of this interface call `Remove` after `Close` without necessarily understanding what `Remove` does. I get that it's a little awkward to have `FifoByteSink` delete t...
filecoin-project-venus
go
@@ -0,0 +1,13 @@ +package core + +import ( + "math/big" + + "github.com/filecoin-project/go-filecoin/types" +) + +type Ask struct { + Price *big.Int + Size *big.Int + Miner types.Address +}
1
1
10,222
Mentioned elsewhere but repeating again: would be nice to have units (ideally `Size *Bytes`).
filecoin-project-venus
go
@@ -269,7 +269,7 @@ describe "Bolt::CLI" do cli.execute(cli.parse) end - it 'install modules from Puppetfile with resolving' do + it 'install modules from Puppetfile without resolving' do cli = Bolt::CLI.new(%W[module install --project #{project} --no-resolve]) allow(inst...
1
# frozen_string_literal: true require 'spec_helper' require 'bolt_spec/files' require 'bolt_spec/task' require 'bolt_spec/project' require 'bolt/cli' require 'bolt/util' require 'concurrent/utility/processor_counter' require 'r10k/action/puppetfile/install' require 'yaml' describe "Bolt::CLI" do include BoltSpec::F...
1
16,545
I think a test in `spec/integration` might help keep this file a bit more manageable, especially since we're just checking file contents and errors. But basically the same idea!
puppetlabs-bolt
rb
@@ -54,7 +54,6 @@ module Selenium it 'does not set the chrome.detach capability by default' do Driver.new(http_client: http) - expect(caps['goog:chromeOptions']).to eq({}) expect(caps['chrome.detach']).to be nil end
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 may not...
1
15,563
This spec can be modified, giving you extra strength (Check this fetch key doesn't work and therefore returns `nil`)
SeleniumHQ-selenium
java
@@ -1105,7 +1105,8 @@ instr_set_label_callback(instr_t *instr, instr_label_callback_t cb) { CLIENT_ASSERT(instr_is_label(instr), "only set callback functions for label instructions"); - CLIENT_ASSERT(instr->label_cb == NULL, "label callback function is already set"); + CLIENT_ASSERT(instr...
1
/* ********************************************************** * Copyright (c) 2011-2021 Google, Inc. All rights reserved. * Copyright (c) 2000-2010 VMware, Inc. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or witho...
1
23,200
So this means that we can remove a callback via instr_set_label_callback(). Maybe consider adding another API function for removal, and add a new assert here such that cb != NULL?
DynamoRIO-dynamorio
c
@@ -30,7 +30,9 @@ <p><%= _("Last modified: ") + l(@plan.updated_at.to_date, formats: :short) %></p> <br> - <p><%= _("Copyright information:") %></p> - <div style="margin-left: 15px;"><p><%= _(" The above plan creator(s) have agreed that others may use as much of the text of this plan as they would like in thei...
1
<hr /> <h1><%= @plan.title %></h1> <p><em> <%= _("A Data Management Plan created using ") + Rails.configuration.branding[:application][:name] %> </em></p> <br/> <div class="cover-page"> <p><%= @hash[:attribution].length > 1 ? _("Creators: ") : _('Creator:') %> <%= @hash[:attribution].join(', ') %></p><br> <p><%=...
1
17,682
why are we using an instance variable instead of accessing the visibility method?
DMPRoadmap-roadmap
rb
@@ -173,6 +173,7 @@ func (h *HTTPTransport) NewTransport(ctx caddy.Context) (*http.Transport, error) dialer.Resolver = &net.Resolver{ PreferGo: true, Dial: func(ctx context.Context, _, _ string) (net.Conn, error) { + //nolint:gosec addr := h.Resolver.netAddrs[weakrand.Intn(len(h.Resolver.netAddrs))] ...
1
// Copyright 2015 Matthew Holt and The Caddy 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 applicab...
1
15,752
Ok. Can we just disable this linter?
caddyserver-caddy
go
@@ -6,7 +6,7 @@ from listenbrainz import config from listenbrainz import db ADMIN_SQL_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..','admin', 'sql') -TEST_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_data') +TEST_DATA_PATH = os.path.join(os.path.dirname(os....
1
import os import unittest from listenbrainz import config from listenbrainz import db ADMIN_SQL_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..','admin', 'sql') TEST_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_data') class DatabaseTestCase(unittest.TestCase...
1
14,576
this is `test_data` and all other instances are `testdata` - does this change affect any test files, or are there actually no directories called `test_data` in the repo? (I just checked, it seems like there aren't...)
metabrainz-listenbrainz-server
py
@@ -48,10 +48,6 @@ public class ApiVersionStrings { return getBasePath() + "/chatter/"; } - public static String getBaseConnectPath() { - return getBasePath() + "/connect/"; - } - public static String getBaseSObjectPath() { return getBasePath() + "/sobjects/"; }
1
/* * Copyright (c) 2013-present, 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 noti...
1
16,956
Fixing `lint` warnings that have existed for a while.
forcedotcom-SalesforceMobileSDK-Android
java
@@ -24,4 +24,9 @@ const ( // EnvKeyForInstallConfigName is the environment variable to get the // the install config's name EnvKeyForInstallConfigName InstallENVKey = "OPENEBS_IO_INSTALL_CONFIG_NAME" + // CASDefaultCstorPoolENVK is the ENV key that specifies wether default cstor pool + // should be configured or ...
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, soft...
1
9,330
Better to rename this to CASDefaultCstorSparsePool.
openebs-maya
go
@@ -105,4 +105,9 @@ public class S3FileIO implements FileIO { this.awsClientFactory = AwsClientFactories.from(properties); this.s3 = awsClientFactory::s3; } + + @Override + public void close() { + client().close(); + } }
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
39,821
Since we'e not 100% sure if `close` will be called more than once, should we set `client` to `null` or add an `AtomicBoolean closed` that will then handle the idempotency issue?
apache-iceberg
java
@@ -379,11 +379,15 @@ Intersection MotorwayHandler::fromRamp(const EdgeID via_eid, Intersection inters // // 7 1 // 0 + const auto &first_intersection_name = + name_table.GetNameForID(first_intersection_data.name_id).to_string(); + ...
1
#include "extractor/guidance/motorway_handler.hpp" #include "extractor/guidance/constants.hpp" #include "extractor/guidance/road_classification.hpp" #include "util/bearing.hpp" #include "util/guidance/name_announcements.hpp" #include <limits> #include <utility> #include <boost/assert.hpp> using osrm::util::angularD...
1
23,162
And here - what happens if name id is invalid
Project-OSRM-osrm-backend
cpp
@@ -0,0 +1,18 @@ +<?php + +declare(strict_types=1); + +namespace Bolt\Storage\Query\Directive; + +use Bolt\Storage\Query\QueryInterface; + +/** + * Directive a raw output of the generated query. + */ +class PrintQueryDirective +{ + public function __invoke(QueryInterface $query): void + { + echo $query; +...
1
1
10,638
__toString() is not a part of QueryInterface
bolt-core
php
@@ -43,7 +43,7 @@ from typing import ( cast, TYPE_CHECKING, ) - +import datetime import numpy as np import pandas as pd from pandas.api.types import is_list_like, is_dict_like, is_scalar
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
18,017
nit: Could you add an empty line between `import datetime` (built-in library block) and `import numpy as np` (third-party library block)?
databricks-koalas
py
@@ -1284,6 +1284,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{ {"CUDA_ERROR_INVALID_PC", {"hipErrorInvalidPc", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 718 // cudaErrorLaunchFailure ...
1
/* Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. 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 us...
1
8,903
Please remove `HIP_UNSUPPORTED`
ROCm-Developer-Tools-HIP
cpp
@@ -30,13 +30,17 @@ import { STORE_NAME as CORE_USER } from '../googlesitekit/datastore/user/constan /** * Gets the current dateRange string. * - * @param {string} [dateRange] Optional. The date range slug. + * @param {string} [dateRange] Optional. The date range slug. + * @param {boolean} [returnNumber] Opt...
1
/** * Utility functions. * * Site Kit by Google, Copyright 2020 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 * * U...
1
32,122
Having boolean parameters to change function behavior is not a good practice because it violates the principle of functions being responsible for a single task, so the need for this indicates we need to split something out of here instead. We can introduce a function like `getCurrentDateRangeDayCount` or similar, which...
google-site-kit-wp
js
@@ -156,7 +156,6 @@ test.suite( await driver.get(fileServer.Pages.basicAuth) let source = await driver.getPageSource() assert.strictEqual(source.includes('Access granted!'), true) - await server.stop() }) })
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
18,850
Is this not required?
SeleniumHQ-selenium
java
@@ -39,17 +39,9 @@ type ( GetContractState(hash.PKHash, hash.Hash32B) (hash.Hash32B, error) SetContractState(hash.PKHash, hash.Hash32B, hash.Hash32B) error // Accounts - Balance(string) (*big.Int, error) - AccountState(string) (*Account, error) RootHash() hash.Hash32B Version() uint64 Height() uint6...
1
// Copyright (c) 2018 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
1
12,698
savedStates is for confirmed states, not needed in working set
iotexproject-iotex-core
go
@@ -23,6 +23,9 @@ import ( "github.com/mysteriumnetwork/node/market" ) +// ServiceType indicates "wireguard" service type +const ServiceType = "wireguard" + // Bootstrap is called on program initialization time and registers various deserializers related to wireguard service func Bootstrap() { market.RegisterS...
1
/* * Copyright (C) 2018 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
13,835
Why should we move it into `bootstrap.go` file?
mysteriumnetwork-node
go
@@ -24,8 +24,15 @@ const fontSizes = [ 72 ] +const measures = [ + 24, + 32, + 48 +] + module.exports = { breakpoints, space, fontSizes, + measures }
1
const breakpoints = [ 40, 52, 64 ] const space = [ 0, 8, 16, 32, 64 ] const fontSizes = [ 12, 14, 16, 20, 24, 32, 48, 64, 72 ] module.exports = { breakpoints, space, fontSizes, }
1
4,464
In the next major version, I plan on changing the em-unit breakpoints to be pixel values to keep everything consistent. Would be great to handle this with pixels as well, but still allow em-units to be defined with a string
styled-system-styled-system
js
@@ -151,7 +151,7 @@ class TabWidget(QTabWidget): fields = self.get_tab_fields(idx) fields['current_title'] = fields['current_title'].replace('&', '&&') - fields['index'] = idx + 1 + fields['index'] = str(idx + 1).rjust(2) title = '' if fmt is None else fmt.format(**fields) ...
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2020 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
25,033
I don't think this will actually align the indexes, if you have > 100 tabs, the tabs over 100 will be misaligned. In addition with less than 10 tabs, there will be a pointless space.
qutebrowser-qutebrowser
py
@@ -326,7 +326,7 @@ func (v4 *signer) buildCanonicalHeaders(r rule, header http.Header) { headerValues[i] = "host:" + v4.Request.URL.Host } else { headerValues[i] = k + ":" + - strings.Join(v4.Request.Header[http.CanonicalHeaderKey(k)], ",") + strings.Join(v4.signedHeaderVals[k], ",") } }
1
// Package v4 implements signing for AWS V4 signer package v4 import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "io" "net/http" "net/url" "sort" "strconv" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" "gith...
1
7,778
hrm, unsigned headers now won't be included.
aws-aws-sdk-go
go
@@ -53,6 +53,7 @@ class CategoryCode */ public static function isValid(string $value): bool { - return strlen($value) <= 255; + return '' !== $value + && strlen($value) < 256; } }
1
<?php /** * Copyright © Bold Brand Commerce Sp. z o.o. All rights reserved. * See LICENSE.txt for license details. */ declare(strict_types = 1); namespace Ergonode\Category\Domain\ValueObject; /** */ class CategoryCode { /** * @var string */ private $value; /** * @param string $value...
1
8,399
what if `$value = ' ' `?
ergonode-backend
php
@@ -262,10 +262,16 @@ class SparkWrite { private class DynamicOverwrite extends BaseBatchWrite { @Override public void commit(WriterCommitMessage[] messages) { + Iterable<DataFile> files = files(messages); + if (Iterables.size(files) == 0) { + LOG.info("Dynamic overwrite is empty, skipping...
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
40,697
What about using `!files.hasNext` instead? I'm not sure we want to assume that the iterable can be consumed multiple times. Plus there's no need to consume the entire iterable just to check whether it is empty.
apache-iceberg
java
@@ -85,6 +85,11 @@ Container* Container::getParentContainer() return thing->getContainer(); } +std::string Container::getName() const { + const ItemType& it = items[id]; + return getNameDescription(it, this, -1, false); +} + bool Container::hasParent() const { return getID() != ITEM_BROWSEFIELD && dynamic_cast...
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
17,198
I think we could add bool addArticle here defaulted to false like its done in item class so std::string Container::getName(bool addArticle /* = false*/) const { and pass that variable to getNameDescription call
otland-forgottenserver
cpp
@@ -47,11 +47,11 @@ public class LockableBottomSheetBehavior<V extends View> extends ViewPagerBottom @Override public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, V child, View directTargetChild, - View target, int nestedScrollAxes) { + ...
1
package de.danoeh.antennapod.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.google.android.material.bottomsheet.ViewPagerBottomSheetBehavior; /** * Based on https...
1
16,887
What if a library function on the outside still calls the old method? It is then no longer blocked properly. Have you tested the change?
AntennaPod-AntennaPod
java
@@ -197,11 +197,15 @@ static mrb_value build_app_response(struct st_mruby_subreq_t *subreq) return resp; } -static void append_bufs(struct st_mruby_subreq_t *subreq, h2o_iovec_t *inbufs, size_t inbufcnt) +static void append_bufs(struct st_mruby_subreq_t *subreq, h2o_sendvec_t *inbufs, size_t inbufcnt) { - i...
1
/* * Copyright (c) 2017 Ichito Nagata, Fastly, 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...
1
13,454
@i110 Do you have an idea on how we should propagate errors that occur in this block? The error condition happens when i) `h2o_buffer_reserve` fails to allocate space (happens in master as well), or ii) `fill_cb` returns an error (unique to this PR).
h2o-h2o
c
@@ -3,7 +3,7 @@ class ReportMailer < ApplicationMailer def budget_status to_email = ENV.fetch('BUDGET_REPORT_RECIPIENT') - date = Time.now.in_time_zone('Eastern Time (US & Canada)').strftime("%a %m/%d/%y") + date = Time.now.utc.strftime("%a %m/%d/%y (%Z)") mail( to: to_email,
1
class ReportMailer < ApplicationMailer add_template_helper ReportHelper def budget_status to_email = ENV.fetch('BUDGET_REPORT_RECIPIENT') date = Time.now.in_time_zone('Eastern Time (US & Canada)').strftime("%a %m/%d/%y") mail( to: to_email, subject: "C2: Daily Budget report for #{date}", ...
1
13,855
Does this mean the times will show up in emails as UTC?
18F-C2
rb
@@ -191,11 +191,10 @@ options.Bounds = Options('style', color='black') options.Ellipse = Options('style', color='black') options.Polygons = Options('style', color=Cycle(), line_color='black', cmap=dflt_cmap) -options.Rectangles = Options('style', cmap=dflt_cmap) -options.Segments = Options...
1
import sys import numpy as np from bokeh.palettes import all_palettes from param import concrete_descendents from ...core import (Store, Overlay, NdOverlay, Layout, AdjointLayout, GridSpace, GridMatrix, NdLayout, config) from ...element import (Curve, Points, Scatter, Image, Raster, Path, ...
1
24,548
What's the motivation for having one of these be a cycle and the other be a fixed color?
holoviz-holoviews
py
@@ -136,7 +136,7 @@ namespace ResultsComparer var table = data.ToMarkdownTable().WithHeaders(conclusion.ToString(), conclusion == EquivalenceTestConclusion.Faster ? "base/diff" : "diff/base", "Base Median (ns)", "Diff Median (ns)", "Modality"); - foreach (var line in table.ToMarkdown().Split...
1
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; usi...
1
9,922
What will be an empty entry now?
dotnet-performance
.cs
@@ -71,6 +71,10 @@ export class ManualColumnResize extends BasePlugin { addClass(this.guide, 'manualColumnResizerGuide'); } + get inlineDir() { + return this.hot.isRtl() ? 'right' : 'left'; + } + /** * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link ...
1
import { BasePlugin } from '../base'; import { addClass, closest, hasClass, removeClass, outerHeight, isDetached } from '../../helpers/dom/element'; import EventManager from '../../eventManager'; import { arrayEach } from '../../helpers/array'; import { rangeEach } from '../../helpers/number'; import { PhysicalIndexToV...
1
20,953
Can I ask you to add jsdoc tag that would mark the prop as `@private`?
handsontable-handsontable
js
@@ -113,3 +113,13 @@ func WriteFile(fromFile io.Reader, to string, mode os.FileMode) error { // And move it to its final destination. return os.Rename(tempFile.Name(), to) } + +// IsDirectory checks if a given path is a directory +func IsDirectory(path string) bool { + info, err := os.Stat(path) + if err != nil { ...
1
// Package fs provides various filesystem helpers. package fs import ( "fmt" "io" "io/ioutil" "os" "path" "syscall" "gopkg.in/op/go-logging.v1" ) var log = logging.MustGetLogger("fs") // DirPermissions are the default permission bits we apply to directories. const DirPermissions = os.ModeDir | 0775 // Ensur...
1
8,599
Do you need this? Don't think you use it?
thought-machine-please
go
@@ -0,0 +1,13 @@ +package com.fsck.k9.widget.list; + + +import android.content.Intent; +import android.widget.RemoteViewsService; + + +public class MessageListWidgetService extends RemoteViewsService { + @Override + public RemoteViewsFactory onGetViewFactory(Intent intent) { + return new MessageListRemoteV...
1
1
14,885
`this.` seems unnecessary
k9mail-k-9
java
@@ -244,8 +244,8 @@ def connect_to_service(service_name, client=True, env=None, region_name=None, en endpoint_url = backend_url config = config or botocore.client.Config() # configure S3 path style addressing - if service_name == 's3': - config.s3 = {'addressing_styl...
1
import os import re import json import time import boto3 import logging import six import botocore from localstack import config from localstack.constants import ( INTERNAL_AWS_ACCESS_KEY_ID, REGION_LOCAL, LOCALHOST, MOTO_ACCOUNT_ID, ENV_DEV, APPLICATION_AMZ_JSON_1_1, APPLICATION_AMZ_JSON_1_0, APPLICATION_X_WWW...
1
12,182
nit: can be removed before merging...
localstack-localstack
py
@@ -2,7 +2,7 @@ describe('ContextMenu', function () { var id = 'testContainer'; beforeEach(function () { - this.$container = $('<div id="' + id + '"></div>').appendTo('body'); + this.$container = $(`<div id="${id}"></div>`).appendTo('body'); }); afterEach(function () {
1
describe('ContextMenu', function () { var id = 'testContainer'; beforeEach(function () { this.$container = $('<div id="' + id + '"></div>').appendTo('body'); }); afterEach(function () { if (this.$container) { destroy(); this.$container.remove(); } }); describe('alignment', functio...
1
14,896
Maybe a single quote would be compatible with airbnb style.
handsontable-handsontable
js
@@ -81,6 +81,10 @@ public abstract class SessionMap implements HasReadyState, Routable { public abstract void remove(SessionId id); + public int getCount() { + return -10; + }; + public URI getUri(SessionId id) throws NoSuchSessionException { return get(id).getUri(); }
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,774
This is not the right approach. The `Distributor` maintains a model of the current state of the Grid. That model already contains the information about every active session. We don't need to modify `SessionMap` to expose it further.
SeleniumHQ-selenium
java
@@ -279,11 +279,9 @@ func TestFormatWithComments(t *testing.T) { if want := `// hi // there -{ - _time: r._time, - io_time: r._value, -// this is the end -} +{_time: r._time, io_time: r._value + // this is the end + } // minimal foo = (arg=[1, 2]) => 1
1
package astutil_test import ( "testing" "github.com/influxdata/flux/ast" "github.com/influxdata/flux/ast/astutil" "github.com/influxdata/flux/parser" ) func TestFormat(t *testing.T) { src := `x=1+2` pkg := parser.ParseSource(src) if ast.Check(pkg) > 0 { t.Fatalf("unexpected error: %s", ast.GetError(pkg)) }...
1
16,918
@Marwes @wolffcm This is the file where I made a change the the expected output. Its a little bit weird, but I think that the final output makes sense for the most part.
influxdata-flux
go
@@ -94,9 +94,11 @@ func IsValidAppType(apptype string) bool { func (app *DdevApp) CreateSettingsFile() (string, error) { app.SetApptypeSettingsPaths() - // If neither settings file options are set, then don't continue + // If neither settings file options are set, then don't continue. Return + // a nil error becau...
1
package ddevapp import ( "fmt" "os" "path/filepath" ) type settingsCreator func(*DdevApp) (string, error) type uploadDir func(*DdevApp) string // hookDefaultComments should probably change its arg from string to app when // config refactor is done. type hookDefaultComments func() []byte type apptypeSettingsPaths...
1
12,404
I think we probably need a util.Warning() here.
drud-ddev
go
@@ -0,0 +1,19 @@ +from quilt3.util import PhysicalKey, get_from_config, fix_url + +from .base import PackageRegistry +from .local import LocalPackageRegistryV1 +from .s3 import S3PackageRegistryV1 + + +def get_package_registry(path=None) -> PackageRegistry: + """ Returns the package registry for a given path """ + ...
1
1
18,695
Let's make have a signature that's consistent with `PhysicalKey.from_path`. Users should also have access to PhysicalKey since that class is part of the API (e.g., `Package.resolve_hash`).
quiltdata-quilt
py
@@ -0,0 +1,10 @@ +/*eslint no-unused-vars: 0*/ +/* exported utils */ + +/** + * Namespace for imports which holds globals of external dependencies. + * @namespace imports + * @memberof axe + */ + +var imports = (axe.imports = {});
1
1
12,904
What is this directive for?
dequelabs-axe-core
js
@@ -155,6 +155,10 @@ class RefactoringChecker(checkers.BaseTokenChecker): 'if a key is present or a default if not, is simpler and considered ' 'more idiomatic, although sometimes a bit slower' ), + 'R1716': ('simplify chained comparison', + ...
1
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2016-2017 Łukasz Rogalski <rogalski.91@gmail.com> # Copyright (c) 2016 Moises Lopez <moylop260@vauxoo.com> # Copyright (c) 2016 Alexander Todorov <atodorov@otb.bg> # Copyright (c) 2017 Hugo <hugovk@users.noreply.githu...
1
10,103
I'd rephrase it as `Simplify chained comparison between the operands`.
PyCQA-pylint
py
@@ -296,11 +296,10 @@ class ProductDataFixture $this->clearResources(); $this->productsByCatnum = []; - $onlyForFirstDomain = false; $this->productDataReferenceInjector->loadReferences( $this->productDataFixtureLoader, $this->persistentReferenceFacade, - ...
1
<?php namespace Shopsys\FrameworkBundle\DataFixtures\Performance; use Doctrine\ORM\EntityManagerInterface; use Faker\Generator as Faker; use Shopsys\FrameworkBundle\Component\Console\ProgressBarFactory; use Shopsys\FrameworkBundle\Component\DataFixture\PersistentReferenceFacade; use Shopsys\FrameworkBundle\Component\...
1
12,509
so in the performance data fixtures, there will be references for the second domain only?
shopsys-shopsys
php
@@ -304,7 +304,7 @@ public class DefaultGridRegistry extends BaseGridRegistry implements GridRegistr if (proxy == null) { return; } - LOG.info("Registered a node " + proxy); + LOG.finest("Registered a node " + proxy); try { lock.lock();
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
16,452
This is wildly unhelpful to users --- they need to know when a proxy has been registered.
SeleniumHQ-selenium
rb
@@ -203,7 +203,7 @@ class ClientPlayback: # https://github.com/mitmproxy/mitmproxy/issues/2197 if hf.request.http_version == "HTTP/2.0": hf.request.http_version = "HTTP/1.1" - host = hf.request.headers.pop(":authority") + host = hf.request.headers...
1
import queue import threading import typing import time from mitmproxy import log from mitmproxy import controller from mitmproxy import exceptions from mitmproxy import http from mitmproxy import flow from mitmproxy import options from mitmproxy import connections from mitmproxy.net import server_spec, tls from mitmp...
1
14,492
If there is no authority header (i.e. someone intentionally deleted it), I would argue we probably don't want a Host header in the replay either. How about we only add it if it exists, and do nothing otherwise?
mitmproxy-mitmproxy
py
@@ -65,12 +65,7 @@ func TaskMetadataHandler(state dockerstate.TaskEngineState, ecsClient api.ECSCli for _, containerResponse := range taskResponse.Containers { networks, err := GetContainerNetworkMetadata(containerResponse.ID, state) if err != nil { - errResponseJSON, err := json.Marshal(err.Error()) ...
1
// Copyright 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" file acco...
1
25,644
is there any unit test that can be updated to verify this?
aws-amazon-ecs-agent
go
@@ -418,7 +418,18 @@ static int cb_lua_filter(const void *data, size_t bytes, lua_pushstring(ctx->lua->state, tag); lua_pushnumber(ctx->lua->state, ts); lua_pushmsgpack(ctx->lua->state, p); - lua_call(ctx->lua->state, 3, 3); + if (ctx->protected_mode) { + ret = lua_pc...
1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Fluent Bit * ========== * Copyright (C) 2019-2020 The Fluent Bit Authors * Copyright (C) 2015-2018 Treasure Data Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in co...
1
11,535
exiting at this point is leaking memory, take a look at the valgrind output. the sbuffer must be destroyed.
fluent-fluent-bit
c
@@ -0,0 +1,13 @@ +def pytest_addoption(parser): + parser.addoption( + '--poppler', + action='store_true', + dest='poppler', + default=False, + help="Indicates poppler tools (incl. pdftoppm) installed" + ) + + +def pytest_configure(config): + if not config.option.poppler: + ...
1
1
21,440
i think you want a different flag and help like `--ffmpeg` or something; and you need to mark any tests you want skipped
quiltdata-quilt
py
@@ -32,9 +32,10 @@ import ( "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/empty" - "github.com/google/knative-gcp/pkg/apis/events/v1alpha1" auditpb "google.golang.org/genproto/googleapis/cloud/audit" logpb "google.golang.org/genproto/googleapis/loggi...
1
/* 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
1
10,359
this needed to change? or it was just some formatting thing?
google-knative-gcp
go
@@ -278,10 +278,11 @@ public class ProcessBesuNodeRunner implements BesuNodeRunner { params.add("--auto-log-bloom-caching-enabled"); params.add("false"); - String level = System.getProperty("root.log.level"); - if (level != null) { - params.add("--logging=" + level); - } + // String level =...
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,642
What's the advantage of doing it this way over, say, changing the `.circleci/config.yaml` to have `TRACE` as the `root.log.level`?
hyperledger-besu
java
@@ -49,6 +49,15 @@ class ApiClient(object): dataset_id (str): id of the dataset to query. """ + @abc.abstractmethod + def fetch_bigquery_iam_policy(self, project_number, dataset_id): + """Gets IAM policy if a bigquery dataset from gcp API call. + + Args: + project_...
1
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
1
32,870
typo: if -> of
forseti-security-forseti-security
py
@@ -270,7 +270,10 @@ func (templateContext) funcMarkdown(input interface{}) (string, error) { buf.Reset() defer bufPool.Put(buf) - md.Convert([]byte(inputStr), buf) + err := md.Convert([]byte(inputStr), buf) + if err != nil { + return "", err + } return buf.String(), nil }
1
// Copyright 2015 Matthew Holt and The Caddy 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 applicab...
1
15,758
It'll be interesting to see who or what this breaks...
caddyserver-caddy
go
@@ -96,7 +96,7 @@ public class InternalSelenseTestBase extends SeleneseTestBase { return; } - log.info("In dev mode. Copying required files in case we're using a WebDriver-backed Selenium"); + log.finest("In dev mode. Copying required files in case we're using a WebDriver-backed Selenium"); P...
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
16,448
This change is incorrect: the current log level is correct.
SeleniumHQ-selenium
py
@@ -58,7 +58,7 @@ type clientFactory struct { // NewClientFactory creates a new ClientFactory func NewClientFactory() ClientFactory { - logger := log.NewDefaultLogger() + logger := log.NewTestLogger() return &clientFactory{ logger: logger,
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
11,747
There are few cases like this where default logger is used from CLI/db tools. I would copy `NewTestLogger` to `NewCLILogger` and use it everywhere in CLI. In future these two might be different.
temporalio-temporal
go
@@ -222,4 +222,16 @@ public abstract class AbstractAuthenticationToken implements Authentication, return sb.toString(); } + + protected static Integer extractKeyHash(String key) { + Object value = nullSafeValue(key); + return value.hashCode(); + } + + protected static Object nullSafeValue(Object value){ + if(...
1
/* * Copyright 2004, 2005, 2006 Acegi Technology Pty Limited * * 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 b...
1
9,209
While it provides re-use, this method does not make sense in `AbstractAuthenticationToken` because it knows nothing of a hash key. Instead, we should move this to a private method within each subclass.
spring-projects-spring-security
java
@@ -322,7 +322,7 @@ def extract_record_set(records, filters, sorting, paginated = {} for rule in pagination_rules: values = apply_filters(filtered, rule) - paginated.update(((x[id_field], x) for x in values)) + paginated.update((id(x), x) for x in values) pa...
1
import re import operator from collections import defaultdict from collections import abc import numbers from kinto.core import utils from kinto.core.decorators import synchronized from kinto.core.storage import ( StorageBase, exceptions, DEFAULT_ID_FIELD, DEFAULT_MODIFIED_FIELD, DEFAULT_DELETED_FIELD, MIS...
1
11,714
index by memory address? I realize I don't understand why we don't just build a list :)
Kinto-kinto
py
@@ -7,6 +7,7 @@ import db.user user_bp = Blueprint("user", __name__) + @user_bp.route("/lastfmscraper/<user_id>.js") @crossdomain() def lastfmscraper(user_id):
1
from __future__ import absolute_import from flask import Blueprint, render_template, request, url_for, Response from flask_login import current_user from werkzeug.exceptions import NotFound from webserver.decorators import crossdomain import db.user user_bp = Blueprint("user", __name__) @user_bp.route("/lastfmscraper...
1
13,198
Not part of this commit, but we thought that this may not be a good place for this url, as it is in the `/user/` namespace (effectively preventing us having a user called `lastfmscraper`, however rare it may be)
metabrainz-listenbrainz-server
py
@@ -25,6 +25,7 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNet internal const string HttpContextKey = "__Datadog.Trace.ClrProfiler.Integrations.AspNetMvcIntegration"; private const string OperationName = "aspnet-mvc.request"; + private const string ChildActionOperationName =...
1
// <copyright file="AspNetMvcIntegration.cs" company="Datadog"> // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. // </copyright> #if NETFRAMEWORK ...
1
24,811
Does not appear to be used.
DataDog-dd-trace-dotnet
.cs
@@ -0,0 +1,15 @@ +test_name "C100546: bolt command run should execute command on remote hosts\ + via ssh" do + step "execute `bolt command run` via SSH" do + ssh_nodes = select_hosts(roles: ['ssh']) + nodes_csv = ssh_nodes.map(&:hostname).join(',') + command = 'hostname -f' + bolt_command = "bolt...
1
1
6,668
I think this starts a new `powershell.exe` interpreter each time, which is pretty slow to run a single command. Can we just do `on(bolt, "cmd /c #{bolt_command}")`? /cc @Iristyle
puppetlabs-bolt
rb
@@ -1,14 +1,14 @@ -<% if @purchaseable.collection? %> +<% if @video_page.purchaseable.collection? %> <% content_for :additional_header_links do %> - <li class="all-videos"><%= link_to 'All Videos', @purchase %></li> + <li class="all-videos"><%= link_to 'All Videos', @video_page.purchase %></li> <% end %> <...
1
<% if @purchaseable.collection? %> <% content_for :additional_header_links do %> <li class="all-videos"><%= link_to 'All Videos', @purchase %></li> <% end %> <% end %> <% content_for :subject_block do %> <h1><%= @purchaseable.name %></h1> <h2 class="tagline"> <% if @purchaseable.collection? %> <%...
1
9,183
Can we add a `collection?` method to the `VideoPage` so we don't violate Law of Demeter here?
thoughtbot-upcase
rb
@@ -1250,14 +1250,6 @@ public class ProjectManagerServlet extends LoginAbstractAzkabanServlet { page.add("errorMsg", e.getMessage()); } - final int numBytes = 1024; - - // Really sucks if we do a lot of these because it'll eat up memory fast. - // But it's expected that this won't be a heavily us...
1
/* * Copyright 2012 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
18,589
Deleting unused code.
azkaban-azkaban
java
@@ -1,6 +1,7 @@ import torch -from ..bbox import PseudoSampler, assign_and_sample, bbox2delta, build_assigner +from ..bbox import assign_and_sample, bbox2delta, build_assigner +from ..bbox.samplers.pseudo_sampler import PseudoSampler from ..utils import multi_apply
1
import torch from ..bbox import PseudoSampler, assign_and_sample, bbox2delta, build_assigner from ..utils import multi_apply def anchor_target(anchor_list, valid_flag_list, gt_bboxes_list, img_metas, target_means, target_stds, ...
1
19,053
`PseudoSampler` can also be imported from `..bbox`
open-mmlab-mmdetection
py
@@ -19,6 +19,7 @@ package agreementtest import ( "fmt" + "github.com/algorand/go-algorand/protocol" "strconv" "time"
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
39,589
Could you move this import to where the other `github.com/algorand/go-algorand` imports are?
algorand-go-algorand
go
@@ -655,7 +655,7 @@ class Conf(ConfClass): # can, tls, http are not loaded by default load_layers = ['bluetooth', 'bluetooth4LE', 'dhcp', 'dhcp6', 'dns', 'dot11', 'dot15d4', 'eap', 'gprs', 'hsrp', 'inet', - 'inet6', 'ipsec', 'ir', 'isakmp', 'l2', 'l2tp', + ...
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 """ Implementation of the configuration object. """ from __future__ import absolute_import from __future__ import print_funct...
1
17,894
I'd rather not activate this protocol by default for now, unless there is a good reason for that.
secdev-scapy
py
@@ -19,11 +19,14 @@ import inspect # pylint: disable=line-too-long from google.cloud.forseti.common.util import logger from google.cloud.forseti.common.util import string_formats +from google.cloud.forseti.services.inventory.storage import DataAccess +from google.cloud.forseti.services.scanner import dao as scanner_...
1
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
1
33,146
Remove these 2 blank lines.
forseti-security-forseti-security
py
@@ -606,6 +606,7 @@ func (pool *TxPool) validateTx(tx types.Transaction, local bool) error { func (pool *TxPool) add(tx types.Transaction, local bool) (replaced bool, err error) { // If the transaction is already known, discard it hash := tx.Hash() + fmt.Printf("aa: %x\n", hash) if pool.all.Get(hash) != nil { ...
1
// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum 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 the License...
1
22,173
Want to remove this?
ledgerwatch-erigon
go
@@ -2,6 +2,7 @@ package sql import ( "github.com/jinzhu/gorm" + // gorm postgres dialect init registration _ "github.com/jinzhu/gorm/dialects/postgres" )
1
package sql import ( "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/postgres" ) type postgres struct{} func (p postgres) connect(connectionString string) (*gorm.DB, error) { db, err := gorm.Open("postgres", connectionString) if err != nil { return nil, sqlError.Wrap(err) } return db, nil }
1
10,630
is this a golint requirement? huh. mixed feelings :)
spiffe-spire
go
@@ -33,6 +33,14 @@ public class BCryptPasswordEncoderTests { String result = encoder.encode("password"); assertThat(result.equals("password")).isFalse(); assertThat(encoder.matches("password", result)).isTrue(); + encoder = new BCryptPasswordEncoder(BCryptPasswordEncoder.BCRYPT_VERSION_2B); + result = encode...
1
/* * Copyright 2002-2011 the original author or 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 ap...
1
11,126
Generally with these tests please split up these tests so that there is a different test for each method
spring-projects-spring-security
java
@@ -1394,16 +1394,16 @@ void nano::bootstrap_attempt::lazy_add (nano::block_hash const & hash_a) } } -void nano::bootstrap_attempt::lazy_pull_flush () +void nano::bootstrap_attempt::lazy_pull_flush (std::unique_lock<std::mutex> & lock_a) { - std::unique_lock<std::mutex> lock (lazy_mutex); + std::unique_lock<std::...
1
#include <nano/node/bootstrap.hpp> #include <nano/node/common.hpp> #include <nano/node/node.hpp> #include <algorithm> #include <boost/log/trivial.hpp> constexpr double bootstrap_connection_scale_target_blocks = 50000.0; constexpr double bootstrap_connection_warmup_time_sec = 5.0; constexpr double bootstrap_minimum_b...
1
14,895
Should something use the lock passed in?
nanocurrency-nano-node
cpp
@@ -101,7 +101,7 @@ class Docker(base.Base): When attempting to utilize a container image with `systemd`_ as your init system inside the container to simulate a real machine, make sure to set - the ``privileged``, ``volume_mounts``, ``command``, and ``environment`` + the ``privileged``, ``volumes``, `...
1
# Copyright (c) 2015-2018 Cisco 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 without limitation the # rights to use, copy, modify, merge...
1
9,308
Is this dependant on some version of Docker? Do we need to include both or `volumes` is deprecated (or just wrong!?)?
ansible-community-molecule
py
@@ -1306,7 +1306,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission try (ZkShardTerms zkShardTerms = new ZkShardTerms(collectionName, slice.getName(), zkController.getZkClient())) { // if an active replica is the leader, then all is fine already Replica leader = sli...
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
38,735
I know this is not new code, but should we change `leader.getState() == State.ACTIVE` to `leader.isActive(liveNodes)`?
apache-lucene-solr
java
@@ -105,7 +105,7 @@ public class JavaRuleViolation extends ParametricRuleViolation<JavaNode> { private void setClassNameFrom(JavaNode node) { String qualifiedName = null; - if (node.getScope() instanceof ClassScope) { + if (node instanceof AbstractAnyTypeDeclaration && node.getScope() inst...
1
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ package net.sourceforge.pmd.lang.java.rule; import java.util.Iterator; import java.util.Set; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleViolation; import net.sourceforg...
1
16,894
Why not use ASTAnyTypeDeclaration? AbstractAnyTypeDeclaration is deprecated
pmd-pmd
java
@@ -119,3 +119,5 @@ from .tools.command import ( version_add, version_list, ) + +from .tools.util import save
1
""" Makes functions in .tools.command accessible directly from quilt. """ # Suppress numpy warnings for Python 2.7 import warnings warnings.filterwarnings("ignore", message="numpy.dtype size changed") # True: Force dev mode # False: Force normal mode # None: CLI params have not yet been parsed to determine mode. _DEV...
1
16,958
A blank line at the very end of each file should eliminate the "No EOF" warning we see above
quiltdata-quilt
py
@@ -818,15 +818,12 @@ func (h *Handler) SignalWithStartWorkflowExecution(ctx context.Context, request // Two simultaneous SignalWithStart requests might try to start a workflow at the same time. // This can result in one of the requests failing with one of two possible errors: - // 1) If it is a brand new W...
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
12,174
These would both be more robust with `errors.As` so that we could safely chain errors.
temporalio-temporal
go
@@ -299,9 +299,9 @@ SwiftArrayBufferHandler::CreateBufferHandler(ValueObject &valobj) { // For now we have to keep the old mangled name since the Objc->Swift bindings // that are in Foundation don't get the new mangling. - if (valobj_typename.startswith(SwiftLanguageRuntime::GetCurrentMangledName("_TtCs23_Cont...
1
//===-- SwiftArray.cpp ------------------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
1
19,898
This is checking the same condition twice?
apple-swift-lldb
cpp
@@ -157,8 +157,16 @@ void lbann_comm::allreduce(AbsDistMat& m, #ifdef LBANN_HAS_GPU if (m.GetLocalDevice() == El::Device::GPU) { #ifdef AL_HAS_NCCL - // Force GPU matrices to use NCCL. + // We require NCCL for GPU matrices. t = std::type_index(typeid(::Al::NCCLBackend)); + // If available, use the MP...
1
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014-2016, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the LBANN Research Team (B. Van Essen, et al.) listed in // the CONTRIBUTORS file. <lbann-dev@l...
1
13,031
Aren't we able to handle the case where we have MPI-CUDA without NCCL, even if it's suboptimal?
LLNL-lbann
cpp
@@ -37,6 +37,12 @@ Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) extern QueryServ* QServ; +namespace detail +{ + static const uint32 PhantomStatId = 999999; +} + + void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, uint32 duration_override, bool followme, bool ...
1
/* EQEMu: Everquest Server Emulator Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) 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; version 2 of the License. This program ...
1
10,779
Wouldn't we want to namespace this `AA` or something similar
EQEmu-Server
cpp
@@ -395,7 +395,13 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, // Load additional config from file(s) sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig) if err != nil { - if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + if le...
1
package session import ( "crypto/tls" "crypto/x509" "fmt" "io" "io/ioutil" "net/http" "os" "time" "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...
1
9,805
This probably should look beyond envConfig, and include `aws.Config.Credentials` as well.
aws-aws-sdk-go
go
@@ -110,6 +110,7 @@ namespace Nethermind.TxPool _filterPipeline.Add(new TooFarNonceFilter(txPoolConfig, _accounts, _transactions, _logger)); _filterPipeline.Add(new TooExpensiveTxFilter(_headInfo, _accounts, _logger)); _filterPipeline.Add(new FeeToLowFilter(_headInfo, _accounts, _...
1
// Copyright (c) 2021 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of ...
1
25,828
How does this filter differ from TooExpensiveTxFilter?
NethermindEth-nethermind
.cs
@@ -217,6 +217,17 @@ public class Project { return users; } + public List<String> getGroupsWithPermission(final Type type) { + final ArrayList<String> groups = new ArrayList<>(); + for (final Map.Entry<String, Permission> entry : this.groupPermissionMap.entrySet()) { + final Permission perm = entr...
1
/* * Copyright 2012 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
18,357
Use " List<String>" instead of ArrayList<String> in declaration.
azkaban-azkaban
java
@@ -93,8 +93,10 @@ class ObjectStore(six.with_metaclass(ABCMeta)): return self.set_object(obj, context, runtime_type, paths) def get_value(self, context, runtime_type, paths): - if runtime_type in self.TYPE_REGISTRY: - return self.TYPE_REGISTRY[runtime_type].get_object(self, context, r...
1
import os import shutil from abc import ABCMeta, abstractmethod from io import BytesIO import six from dagster import check, seven from dagster.utils import mkdir_p from .execution_context import SystemPipelineExecutionContext from .runs import RunStorageMode from .types.runtime import RuntimeType, resolve_to_runti...
1
12,929
we might consider hard throwing when name is None since that is explicitly not working right now and then linking to issue in the exception error message
dagster-io-dagster
py
@@ -1,13 +1,19 @@ package edu.harvard.iq.dataverse; +import edu.harvard.iq.dataverse.util.BundleUtil; import java.io.Serializable; +import java.util.MissingResourceException; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persist...
1
package edu.harvard.iq.dataverse; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; /** * * @author ekraffmiller * Re...
1
44,206
Just noticed this - why "like" and not straight "="
IQSS-dataverse
java
@@ -1,15 +1,16 @@ require 'spec_helper' describe Travis::Build::Data::Env do - let(:data) { stub('data', pull_request: '100', config: { env: 'FOO=foo' }, build: {}, job: {}, repository: {}) } + let(:data) { stub('data', pull_request: '100', config: { env: 'FOO=foo' }, build: { id: '1', number: '1' }, job: { id: '...
1
require 'spec_helper' describe Travis::Build::Data::Env do let(:data) { stub('data', pull_request: '100', config: { env: 'FOO=foo' }, build: {}, job: {}, repository: {}) } let(:env) { described_class.new(data) } it 'vars respond to :key' do env.vars.first.should respond_to(:key) end it 'includes travi...
1
10,468
is this a new test? if yes, isn't it better to check for each env var is present, and the value, instead of a count?
travis-ci-travis-build
rb
@@ -160,10 +160,10 @@ public class MicroserviceVersions { setInstances(pulledInstances, rev); validated = true; } catch (Throwable e) { - LOGGER.error("Failed to setInstances, appId={}, microserviceName={}.", - getAppId(), - getMicroserviceName(), - e); + LOGGER.e...
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
10,661
when will lost exception? by my test, never happened.
apache-servicecomb-java-chassis
java
@@ -147,7 +147,8 @@ class BrowserPage(QWebPage): title="Open external application for {}-link?".format(scheme), text="URL: <b>{}</b>".format( html.escape(url.toDisplayString())), - yes_action=functools.partial(QDesktopServices.openUrl, url)) + ...
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,593
You should re-stringify it here with `QUrl.FullyEncoded`.
qutebrowser-qutebrowser
py
@@ -128,9 +128,9 @@ func Wrap(ctx context.Context, topic Topic, msg []byte, recipient *ecdsa.PublicK return mine(ctx, odd, f) } -// Unwrap takes a chunk, a topic and a private key, and tries to decrypt the payload +// Unwrap takes a private key, a chunk, an array of possible topics and tries to decrypt the payload...
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 pss import ( "bytes" "context" "crypto/ecdsa" "encoding/binary" "encoding/hex" "errors" "fmt" random "math/rand" "github.com/btcsuite/btcd...
1
13,062
i'm not sure why the quit channel is needed in this context
ethersphere-bee
go
@@ -64,13 +64,16 @@ func MakeIngressDeployment(args IngressArgs) *appsv1.Deployment { } container.Resources = corev1.ResourceRequirements{ Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("1000Mi"), + corev1.ResourceMemory: resource.MustParse(args.MemoryLimit), }, Requests: core...
1
/* Copyright 2020 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
1
16,890
When `args.MemoryLimit` is empty, will `MustParse` panic?
google-knative-gcp
go
@@ -122,6 +122,11 @@ func (r *RouteTable) SetRoutes(ifaceName string, targets []Target) { r.dirtyIfaces.Add(ifaceName) } +func (r *RouteTable) QueueResync() { + r.logCxt.Info("Queueing a resync.") + r.inSync = false +} + func (r *RouteTable) Apply() error { if !r.inSync { links, err := r.dataplane.LinkList()
1
// Copyright (c) 2016-2017 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ...
1
15,063
How soon after this will Apply() be called? It would be a shame if there was still a significant delay before a missing or superfluous route was corrected.
projectcalico-felix
c
@@ -23,6 +23,7 @@ import ( ) type nonceWithTTL struct { + idx int nonce uint64 deadline time.Time }
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
24,655
I add a `idx` property, and it is only use for benchmark `heap.Remove`, is it acceptable?
iotexproject-iotex-core
go
@@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2018 NV Access Limited, Babbage B.V., Davy Kager +#Copyright (C) 2006-2019tNV Access Limited, Babbage B.V., Davy Kager, Derek Riemer #This file is covered by the GNU General Public License. #See the file COPYING ...
1
# -*- coding: UTF-8 -*- #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2006-2018 NV Access Limited, Babbage B.V., Davy Kager #This file is covered by the GNU General Public License. #See the file COPYING for more details. from cStringIO import StringIO from configobj import ConfigObj #: The versio...
1
24,684
daemonic t got inserted.
nvaccess-nvda
py
@@ -532,7 +532,8 @@ public class DefaultBlockchain implements MutableBlockchain { if (!genesisHash.get().equals(genesisBlock.getHash())) { throw new InvalidConfigurationException( "Supplied genesis block does not match stored chain data.\n" - + "Please specify a different dat...
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
24,072
This edit is non-essential.
hyperledger-besu
java
@@ -14,6 +14,14 @@ import { const isWeakMapSupported = typeof WeakMap == 'function'; +Object.setPrototypeOf = + Object.setPrototypeOf || + function(obj, proto) { + // eslint-disable-next-line + obj.__proto__ = proto; + return obj; + }; + function getClosestDomNodeParent(parent) { if (!parent) return {}; if...
1
import { checkPropTypes } from './check-props'; import { options, Component } from 'preact'; import { ELEMENT_NODE, DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE } from './constants'; import { getOwnerStack, setupComponentStack, getCurrentVNode, getDisplayName } from './component-stack'; const isWeakMapSupported = type...
1
15,717
Might be safer to ponyfill this?
preactjs-preact
js
@@ -57,18 +57,11 @@ func Create(dir string) (*Local, error) { } // test if config file already exists - _, err := os.Lstat(backend.Paths.Config) + _, err := os.Lstat(filepath.Join(dir, backend.Paths.Config)) if err == nil { return nil, errors.New("config file already exists") } - // test if directories a...
1
package local import ( "errors" "fmt" "io" "io/ioutil" "os" "path/filepath" "sort" "sync" "github.com/restic/restic/backend" ) var ErrWrongData = errors.New("wrong data returned by backend, checksum does not match") type Local struct { p string mu sync.Mutex open map[string][]*os.File // Contains o...
1
6,898
why was this join not necessary before?
restic-restic
go
@@ -163,6 +163,17 @@ public class TestExitableDirectoryReader extends LuceneTestCase { searcher.search(query, 10); reader.close(); + // Set a fairly high timeout value (infinite) and expect the query to complete in that time frame. + // Not checking the validity of the result, but checking the samplin...
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,830
Here we compare to the expected call count 3. Because 3 TermsEnum are created: it is a PrefixQuery and there is one TermsEnum created for AutomatonQuery.intersect() (the next call timeout check is skipped once), then 2 TermsEnum created for the 2 matching terms "one" and "ones"). Would it be clearer to have a separate ...
apache-lucene-solr
java
@@ -28,6 +28,9 @@ module Bolt when 'file' { flags: ACTION_OPTS + %w[tmpdir], banner: FILE_HELP } + when 'inventory' + { flags: OPTIONS[:inventory] + OPTIONS[:global] + %w[format inventoryfile boltdir configfile], + banner: INVENTORY_HELP } when 'plan' case...
1
# frozen_string_literal: true # Note this file includes very few 'requires' because it expects to be used from the CLI. require 'optparse' module Bolt class BoltOptionParser < OptionParser OPTIONS = { inventory: %w[nodes targets query rerun description], authentication: %w[user password private...
1
11,839
Add `--format` as an option. Does it make sense to have all display options available? Also need to add `--inventoryfile` and possibly the global_config_options.
puppetlabs-bolt
rb
@@ -53,5 +53,10 @@ namespace OpenTelemetry.Instrumentation.AspNetCore /// The type of this object depends on the event, which is given by the above parameter.</para> /// </remarks> public Action<Activity, string, object> Enrich { get; set; } + + /// <summary> + /// Gets or sets ...
1
// <copyright file="AspNetCoreInstrumentationOptions.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
17,659
Any thoughts on making this false by default? My suggestion is make this opt-in. Storing exception is somewhat expensive, so lets do this only if users opt-in
open-telemetry-opentelemetry-dotnet
.cs
@@ -88,7 +88,7 @@ public final class HttpCall<V> extends Call.Base<V> { } else { try { callback.onSuccess(parseResponse(response, bodyConverter)); - } catch (IOException e) { + } catch (Throwable e) { callback.onError(e); } }
1
/* * Copyright 2015-2019 The OpenZipkin 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 a...
1
15,310
usually I do either ` IOException|RuntimeException` or if doing Throwable, use propagateIfFatal
openzipkin-zipkin
java
@@ -24,10 +24,14 @@ class Overlayable(object): def __mul__(self, other): if type(other).__name__ == 'DynamicMap': - from ..util import Dynamic - def dynamic_mul(element): + from .spaces import Callable + def dynamic_mul(*args, **kwargs): + eleme...
1
""" Supplies Layer and related classes that allow overlaying of Views, including Overlay. A Layer is the final extension of View base class that allows Views to be overlayed on top of each other. Also supplies ViewMap which is the primary multi-dimensional Map type for indexing, slicing and animating collections of Vi...
1
15,761
Wondering whether it should be `self.clone`, or `other.clone` or maybe a new `DynamicMap` declaration entirely. I see this is in the condition where `other` is a `DynamicMap`but is this definitely right in terms of `kdims`? I need to think about it more...
holoviz-holoviews
py
@@ -34,7 +34,7 @@ public interface SolrInfoBean { * Category of Solr component. */ enum Category { CONTAINER, ADMIN, CORE, QUERY, UPDATE, CACHE, HIGHLIGHTER, QUERYPARSER, SPELLCHECKER, - SEARCHER, REPLICATION, TLOG, INDEX, DIRECTORY, HTTP, OTHER } + SEARCHER, REPLICATION, TLOG, INDEX, DIRECTORY, HTTP, ...
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
27,773
I chose a new category because over time I'd like to add metrics also for Authorization plugins and Auditlog plugins (all components registered in security.json). An alternative could have been `CONTAINER` I guess?
apache-lucene-solr
java