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
@@ -125,6 +125,10 @@ type Task struct { // ENI is the elastic network interface specified by this task ENI *ENI eniLock sync.RWMutex + + // memoryCPULimitsEnabled to determine if task supports CPU, memory limits + memoryCPULimitsEnabled bool + memoryCPULimitsEnabledLock sync.RWMutex } // PostUnmarshal...
1
// Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license...
1
17,442
Does this need to be saved in the state file? Or are we recomputing when the task is read from the state file?
aws-amazon-ecs-agent
go
@@ -503,11 +503,11 @@ func (s *Sublist) Stats() *SublistStats { st := &SublistStats{} st.NumSubs = s.count st.NumCache = uint32(len(s.cache)) - st.NumInserts = s.inserts - st.NumRemoves = s.removes - st.NumMatches = s.matches - if s.matches > 0 { - st.CacheHitRate = float64(s.cacheHits) / float64(s.matches) + st...
1
// Copyright 2016 Apcera Inc. All rights reserved. // Package sublist is a routing mechanism to handle subject distribution // and provides a facility to match subjects from published messages to // interested subscribers. Subscribers can have wildcard subjects to match // multiple published subjects. package server ...
1
6,863
Looks like `s.inserts` and `s.removes` are updated under sublist's lock, so I don't think you need atomic for those 2.
nats-io-nats-server
go
@@ -39,7 +39,10 @@ void setUseStaticIP(bool enabled) { void markGotIP() { lastGetIPmoment = millis(); + // Create the 'got IP event' so mark the wifiStatus to not have the got IP flag set + // This also implies the services are not fully initialized. wifiStatus &= ~ESPEASY_WIFI_GOT_IP; + wifiStatus ...
1
#ifdef HAS_ETHERNET #include "ETH.h" #endif #include "ESPEasyWiFiEvent.h" #include "ESPEasyWifi_ProcessEvent.h" #include "src/Globals/ESPEasyWiFiEvent.h" #include "src/Globals/RTC.h" #include "ESPEasyTimeTypes.h" #include "ESPEasy_Log.h" #include "ESPEasy_fdwdecl.h" #include "src/DataStructs/RTCStruct.h" #include "sr...
1
19,986
@TD-er use bitRead/bitWrite macros, do you use here inversed logic?
letscontrolit-ESPEasy
cpp
@@ -19,11 +19,11 @@ /** * External dependencies */ +import fetchMock from 'fetch-mock-jest'; /** * WordPress dependencies */ -import apiFetch from '@wordpress/api-fetch'; import { createRegistry } from '@wordpress/data'; /**
1
/** * Settings datastore functions tests. * * 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/LI...
1
29,174
The previous `fetch` mock was exposed globally before - can we do the same with `fetchMock` so we don't need to import it in every file?
google-site-kit-wp
js
@@ -29,9 +29,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 HttpRequestHeaders headers, Http2Stream context) { - if (!context.ExpectData) + if (context.EndStreamReceived) { - return MessageBody.ZeroContentLength...
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.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal...
1
14,119
Is ExpectData still used anywhere?
aspnet-KestrelHttpServer
.cs
@@ -230,7 +230,7 @@ class Docstring: class SphinxDocstring(Docstring): re_type = r""" - [~!]? # Optional link style prefix + [~!.]? # Optional link style prefix \w(?:\w|\.[^\.])* # Valid python name """
1
# -*- coding: utf-8 -*- # Copyright (c) 2016-2018 Ashley Whetter <ashley@awhetter.co.uk> # Copyright (c) 2016-2017 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2016 Yuri Bochkarev <baltazar.bz@gmail.com> # Copyright (c) 2016 Glenn Matthews <glenn@e-dad.net> # Copyright (c) 2016 Moises Lopez <moylop260@vauxoo.co...
1
11,324
Do you want to allow the character `.` or any character? Because inside a regex `.` means any character, if you want to authorize `.` then you need to add `\.` .
PyCQA-pylint
py
@@ -711,4 +711,18 @@ describe('QueryCursor', function() { assert.deepEqual(arr, ['KICKBOXER', 'IP MAN', 'ENTER THE DRAGON']); }); }); + it('returns array for schema hooks gh-9982', () => { + const testSchema = new mongoose.Schema({ name: String }); + testSchema.post('find', (result) => { + as...
1
/** * Module dependencies. */ 'use strict'; const start = require('./common'); const assert = require('assert'); const co = require('co'); const mongoose = start.mongoose; const Schema = mongoose.Schema; describe('QueryCursor', function() { let db; let Model; before(function() { db = start(); }); ...
1
14,553
`eachAsync()` should pass a doc, not an array of docs, to the callback. This would be a massive breaking change.
Automattic-mongoose
js
@@ -323,11 +323,11 @@ func (uc *UpstreamController) updatePodStatus(stop chan struct{}) { } default: - klog.Infof("pod status operation: %s unsupported", msg.GetOperation()) + klog.Warningf("pod status operation: %s unsupported", msg.GetOperation()) } - klog.Infof("message: %s process successfull...
1
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
1
13,927
please start log with caps letters
kubeedge-kubeedge
go
@@ -10,4 +10,5 @@ <%= render 'layouts/typekit' %> <%= csrf_meta_tag %> <%= render 'layouts/ie_shiv' %> +<%= render 'layouts/visual_website_optimizer' %> <%= yield :head %>
1
<meta charset="utf-8" /> <title><%= page_title(app_name: t('layouts.app_name')) %></title> <%= render 'layouts/stylesheets' %> <link rel="icon" href="/favicon.ico" type="image/x-icon"> <meta http-equiv="Description" name="Description" content="<%= yield(:meta_description).presence || t('layouts.meta_description') %>" /...
1
10,209
Is this where we want it in relation to the other scripts?
thoughtbot-upcase
rb
@@ -13,6 +13,7 @@ _, T */ + var FEATURE_NAME = "reports"; window.ReportingView = countlyView.extend({ featureName: 'reports',
1
/*global Handlebars, CountlyHelpers, countlyGlobal, countlyAuth, countlyView, countlyEvent, ReportingView, countlyReporting, jQuery, app, $, _, T */ window.ReportingView = countlyView.extend({ featureName: 'reports', statusChanged: {}, emailInput: {}, ...
1
14,303
Please wrap this variable within a self invoking anonymous function. (function(){ FEATURE_NAME = "reports"; //and rest of the js goes here. })();
Countly-countly-server
js
@@ -393,6 +393,14 @@ func (c *linuxContainer) Signal(s os.Signal, all bool) error { if err := c.initProcess.signal(s); err != nil { return fmt.Errorf("unable to signal init: %w", err) } + if status == Paused { + // For cgroup v1, killing a process in a frozen cgroup + // does nothing until it's thawed. O...
1
package libcontainer import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net" "os" "os/exec" "path/filepath" "reflect" "strconv" "strings" "sync" "time" "github.com/checkpoint-restore/go-criu/v5" criurpc "github.com/checkpoint-restore/go-criu/v5/rpc" securejoin "github.com/cyphar/filep...
1
24,887
Haven't tried, but what happens currently if `-f` is used and it's not running? (thinking: `-f` should ignore the case and just proceed?) I see we have a special case for `all`
opencontainers-runc
go
@@ -1,10 +1,11 @@ 'use strict'; const { MongoClient } = require('../../src'); const { expect } = require('chai'); +const { MongoURIError } = require('../../src/error'); describe('LDAP', function () { if (process.env.MONGODB_URI == null) { - throw new Error(`skipping SSL tests, MONGODB_URI environment variab...
1
'use strict'; const { MongoClient } = require('../../src'); const { expect } = require('chai'); describe('LDAP', function () { if (process.env.MONGODB_URI == null) { throw new Error(`skipping SSL tests, MONGODB_URI environment variable is not defined`); } it('Should correctly authenticate against ldap', fun...
1
20,718
no need for custom errors in tests unless the tests are intended to mock a specific sort of error
mongodb-node-mongodb-native
js
@@ -21,4 +21,6 @@ const ( NvidiaGPUStatusAnnotationKey = "huawei.com/gpu-status" // NvidiaGPUScalarResourceName is the device plugin resource name used for special handling NvidiaGPUScalarResourceName = "nvidia.com/gpu" + + EdgeNodeRoleLabelKey = "node-role.kubernetes.io/edge" )
1
package constants // Service level constants const ( ResourceNodeIDIndex = 1 ResourceNamespaceIndex = 2 ResourceResourceTypeIndex = 3 ResourceResourceNameIndex = 4 EdgeSiteResourceNamespaceIndex = 0 EdgeSiteResourceResourceTypeIndex = 1 EdgeSiteResourceResourceNameIndex = 2 ResourceNode = "node" ...
1
20,079
This const has already existed in the code, no need to define a new one
kubeedge-kubeedge
go
@@ -362,7 +362,7 @@ func captureErrorLogs(algohConfig algoh.HostConfig, errorOutput stdCollector, ou func reportErrorf(format string, args ...interface{}) { fmt.Fprintf(os.Stderr, format, args...) - logging.Base().Fatalf(format, args...) + logging.Base().Warnf(format, args...) } func sendLogs() {
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
42,137
Would Errorf be better than Warnf?
algorand-go-algorand
go
@@ -93,15 +93,16 @@ public class JSExport { } public static String getCordovaPluginJS(Context context) { - return getFilesContent(context, "public/plugins", ""); + return getFilesContent(context, "public/plugins"); } - public static String getFilesContent(Context context, String path, String current...
1
package com.getcapacitor; import android.content.Context; import android.text.TextUtils; import android.util.Log; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class JSExport { priv...
1
7,152
A good candidate for StringBuilder? Also make sure to add white space around the operators (`path + "/" + file`)
ionic-team-capacitor
js
@@ -200,4 +200,17 @@ public interface ProjectLoader { throws ProjectManagerException; void updateProjectSettings(Project project) throws ProjectManagerException; + + /** + * Uploads flow file. + */ + void uploadFlowFile(int projectId, int projectVersion, int flowVersion, + File flowFile) throws P...
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
15,205
Can we have the same argument order as `getUploadedFlowFile`?
azkaban-azkaban
java
@@ -46,7 +46,7 @@ type ( RangeSize int64 GetTasksBatchSize dynamicconfig.IntPropertyFnWithTaskQueueInfoFilters UpdateAckInterval dynamicconfig.DurationPropertyFnWithTaskQueueInfoFilters - IdleTaskqueueCheckInterval dynamicconfig.DurationPropertyFnWithTaskQueueInfoFil...
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,281
this dynamic config should still be valid, i.e. operator should have the ability to control each individual task queue just in case
temporalio-temporal
go
@@ -394,6 +394,17 @@ class VirtualBufferTextInfo(browseMode.BrowseModeDocumentTextInfo,textInfos.offs obj = self.obj.getNVDAObjectFromIdentifier(docHandle, nodeId) return obj.mathMl + def scrollIntoView(self): + # Scroll the deepest object at this point into view. + obj = self.NVDAObjectAtStart + if not obj:...
1
# -*- coding: UTF-8 -*- #virtualBuffers/__init__.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2007-2017 NV Access Limited, Peter Vágner import time import threading import ctypes import collection...
1
33,837
Should these cases be logged? `if not obj` used to be
nvaccess-nvda
py
@@ -0,0 +1,19 @@ +require 'travis/build/appliances/base' + +module Travis + module Build + module Appliances + class UpdateAptKeys < Base + def apply + command = <<-EOF + if command -v apt-get &>/dev/null && [[ -d /var/lib/apt/lists ]]; then + LANG=C apt-key list | awk -F'[ ...
1
1
15,802
Is it OK to assume that keys.gnupg.net has the new key?
travis-ci-travis-build
rb
@@ -128,11 +128,6 @@ class FileSystem(object): exist, raise luigi.target.MissingParentDirectory :param bool raise_if_exists: raise luigi.target.FileAlreadyExists if the folder already exists. - - *Note*: This method is optional, not all...
1
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
1
16,214
A note for however is curious. I think these two notes add negative value only. In general we want people to implement this method (in particular after this patch). If we leave these old (and currently mis-rendered) notes, file system implementors might not implement this method referring to this.
spotify-luigi
py
@@ -216,15 +216,12 @@ public class PriorityQueueTest extends AbstractTraversableTest { empty().dequeue(); } - // -- toSortedQueue + // -- toPriorityQueue @Test - public void shouldKeepInstanceOfSortedQueue() { - final SerializableComparator<Integer> comparator = naturalComparator(...
1
/* / \____ _ _ ____ ______ / \ ____ __ _______ * / / \/ \ / \/ \ / /\__\/ // \/ \ // /\__\ JΛVΛSLΛNG * _/ / /\ \ \/ / /\ \\__\\ \ // /\ \ /\\/ \ /__\ \ Copyright 2014-2016 Javaslang, http://javaslang.io * /___/\_/ \_/\____/\_/ \_/\__\/__/\__\_/ \_// \__/\_____/ ...
1
9,316
Comparators (or functions in general) cannot be compared for equality. Therefore `PriorityQueue.of(comparator, ...)` always has to return a new instance.
vavr-io-vavr
java
@@ -27,7 +27,7 @@ module Bolt @noop = noop @run_as = nil - @pool = Concurrent::CachedThreadPool.new(max_threads: @config[:concurrency]) + @pool = Concurrent::ThreadPoolExecutor.new(max_threads: @config[:concurrency]) @logger.debug { "Started with #{@config[:concurrency]} max thread(s)" ...
1
# frozen_string_literal: true # Used for $ERROR_INFO. This *must* be capitalized! require 'English' require 'json' require 'concurrent' require 'logging' require 'bolt/result' require 'bolt/config' require 'bolt/notifier' require 'bolt/result_set' require 'bolt/puppetdb' module Bolt class Executor attr_reader :...
1
8,626
It's a little surprising that CachedThreadPool overrides the max_threads argument. This makes sense as a solution though.
puppetlabs-bolt
rb
@@ -42,12 +42,14 @@ def weight_reduce_loss(loss, weight=None, reduction='mean', avg_factor=None): # if avg_factor is not specified, just reduce the loss if avg_factor is None: loss = reduce_loss(loss, reduction) - # otherwise average the loss by avg_factor - else: - if reduction != 'mean...
1
import functools import torch.nn.functional as F def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum". Return: Tensor: Reduced loss tensor. """ reduction_enum = ...
1
17,617
```python # if avg_factor is not specified, just reduce the loss if avg_factor is None: loss = reduce_loss(loss, reduction) else: # if reduction is mean, then average the loss by avg_factor if reduction == 'mean': loss = loss.sum() / avg_factor # if reduction is 'none', then do nothing, otherwise raise an error elif re...
open-mmlab-mmdetection
py
@@ -46,9 +46,9 @@ class BasicBlock(nn.Module): planes, planes, 3, - stride=stride, - padding=dilation, - dilation=dilation, + stride=1, + padding=1, + dilation=1, bias=False) self.add_module(se...
1
import logging import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import constant_init, kaiming_init from mmcv.runner import load_checkpoint from mmdet.ops import DeformConv, ModulatedDeformConv from ..registry import BACKBONES from ..utils import build_conv_layer, build_norm_layer class Basic...
1
17,245
`padding` should be 0 instead. Actually you can just remove padding and dilation to use default values.
open-mmlab-mmdetection
py
@@ -1447,7 +1447,7 @@ class Aleph extends AbstractBase implements \Laminas\Log\LoggerAwareInterface, $checkout = $finesListSort[$key]["checkout"]; $transactiondate = $finesListSort[$key]["transactiondate"]; $transactiontype = $finesListSort[$key]["transactiontype"]; - $...
1
<?php /** * Aleph ILS driver * * PHP version 7 * * Copyright (C) UB/FU Berlin * * last update: 7.11.2007 * tested with X-Server Aleph 18.1. * * TODO: login, course information, getNewItems, duedate in holdings, * https connection to x-server, ... * * This program is free software; you can redistribute it a...
1
33,135
$balance is initialized to 0 above in line 1428 and then assigned in line 1437. If we're no longer manipulating that value, is there a reason to use a variable at all? It might make the overall code less confusing to make some changes there.
vufind-org-vufind
php
@@ -73,9 +73,9 @@ class SeriesPlotTest(ReusedSQLTestCase, TestUtils): pdf = self.pdf1 kdf = self.kdf1 - ax1 = pdf['a'].plot("bar", colormap='Paired') + ax1 = pdf['a'].plot(kind="bar", colormap='Paired') bin1 = self.plot_to_base64(ax1) - ax2 = kdf['a'].plot("bar", colorm...
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
13,903
Why do we need to explicitly use keyword arguments?
databricks-koalas
py
@@ -708,7 +708,8 @@ func (c *Client) updateProgress(tid int, target *core.BuildTarget, metadata *pb. case pb.ExecutionStage_EXECUTING: c.state.LogBuildResult(tid, target.Label, core.TargetBuilding, "Building...") case pb.ExecutionStage_COMPLETED: - c.state.LogBuildResult(tid, target.Label, core.TargetBuilt,...
1
// Package remote provides our interface to the Google remote execution APIs // (https://github.com/bazelbuild/remote-apis) which Please can use to distribute // work to remote servers. package remote import ( "context" "encoding/hex" "fmt" "io/ioutil" "os" "path" "path/filepath" "strings" "sync" "time" "g...
1
9,141
Might still want to log this as `TargetBuilding` but with a slightly different message?
thought-machine-please
go
@@ -6,6 +6,17 @@ C015_queue_element::C015_queue_element() {} +C015_queue_element::C015_queue_element(C015_queue_element&& other) + : idx(other.idx), _timestamp(other._timestamp), TaskIndex(other.TaskIndex) + , controller_idx(other.controller_idx), valuesSent(other.valuesSent) + , valueCount(other.valueCount) +{...
1
#include "../ControllerQueue/C015_queue_element.h" #include "../DataStructs/ESPEasy_EventStruct.h" #ifdef USES_C015 C015_queue_element::C015_queue_element() {} C015_queue_element::C015_queue_element(const struct EventStruct *event, byte value_count) : idx(event->idx), TaskIndex(event->TaskIndex), controller_i...
1
21,945
ref. above, this also can be omitted in case `txt = std::move(other.txt);` could work (or copy), consider `std::array<String, VARS_PER_TASK>;`? or a custom object implementing `Object& operator=(Object&&) noexcept;'
letscontrolit-ESPEasy
cpp
@@ -10,7 +10,7 @@ """Looks for try/except statements with too much code in the try clause.""" -from astroid.node_classes import For, If, While, With +from astroid import nodes from pylint import checkers, interfaces
1
# Copyright (c) 2019-2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2019-2020 Tyler Thieding <tyler@thieding.com> # Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com> # Copyright (c) 2020 Anthony Sottile <asottile@umich.edu> # Copyright (c) 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com> # Copyright...
1
15,396
Well done, we forget that one apparentely.
PyCQA-pylint
py
@@ -25,17 +25,6 @@ except: xr = None -def toarray(v, index_value=False): - """ - Interface helper function to turn dask Arrays into numpy arrays as - necessary. If index_value is True, a value is returned instead of - an array holding a single value. - """ - if dask and isinstance(v, dask.arr...
1
import itertools import param import numpy as np from ..core import Dataset, OrderedDict from ..core.operation import ElementOperation from ..core.util import (is_nan, sort_topologically, one_to_one, cartesian_product, is_cyclic) try: import pandas as pd from ..core.data import Panda...
1
15,956
Guess it isn't used. The dask thing was just a prototype so removing it is probably the right thing to do.
holoviz-holoviews
py
@@ -12,7 +12,17 @@ from elasticsearch.helpers import bulk from t4_lambda_shared.preview import ELASTIC_LIMIT_BYTES -CONTENT_INDEX_EXTS = [ +def _get_extension_overrides(): + """check the environment for index extension overrides; this is a standalone + function so that it can be unit tested""" + return { ...
1
""" core logic for fetching documents from S3 and queueing them locally before sending to elastic search in memory-limited batches""" from datetime import datetime from math import floor import os from aws_requests_auth.aws_auth import AWSRequestsAuth import boto3 from elasticsearch import Elasticsearch, RequestsHttpC...
1
18,635
This code is correct, but it's a bit confusing to see how (e.g., without the if startswith(".') the or below would break.) I think it will be clearer for the long run if you refactor this just a bit. CONTENT_INDEX_EXTS (all caps) looks like a constant, but is now being set by the environment. Instead, replace the refer...
quiltdata-quilt
py
@@ -298,4 +298,9 @@ public final class ZMSConsts { public static final int ZMS_DISABLED_AUTHORITY_FILTER = 0x01; public static final String ZMS_PROP_STATUS_CHECKER_FACTORY_CLASS = "athenz.zms.status_checker_factory_class"; + + public static final String ZMS_PROP_ENABLE_PRINCIPAL_STATE_UPDATER = "a...
1
/* * Copyright 2016 Yahoo 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
5,446
please update the zms conf file to have a small description of these options since by default feature is off and must be enabled
AthenZ-athenz
java
@@ -31,7 +31,12 @@ module.exports = class ThumbnailGenerator extends Plugin { const defaultOptions = { thumbnailWidth: null, thumbnailHeight: null, - waitForThumbnailsBeforeUpload: false + waitForThumbnailsBeforeUpload: false, + lazy: false + } + + if (defaultOptions.lazy && defa...
1
const { Plugin } = require('@uppy/core') const Translator = require('@uppy/utils/lib/Translator') const dataURItoBlob = require('@uppy/utils/lib/dataURItoBlob') const isObjectURL = require('@uppy/utils/lib/isObjectURL') const isPreviewSupported = require('@uppy/utils/lib/isPreviewSupported') const MathLog2 = require('m...
1
12,952
Should be `this.opts` instead of `defaultOptions`
transloadit-uppy
js
@@ -27,6 +27,7 @@ const pkgVersion = module.exports.version; const pkgName = module.exports.name; export const DIST_TAGS = 'dist-tags'; +export const USERS = 'users'; export function getUserAgent(): string { assert(_.isString(pkgName));
1
// @flow import _ from 'lodash'; import fs from 'fs'; import assert from 'assert'; import semver from 'semver'; import YAML from 'js-yaml'; import URL from 'url'; import createError from 'http-errors'; import marked from 'marked'; import { HTTP_STATUS, API_ERROR, DEFAULT_PORT, DEFAULT_DOMAIN, } from './constan...
1
19,849
You can reuse `USERS` above as well.
verdaccio-verdaccio
js
@@ -460,11 +460,6 @@ public final class Util { continue; } - if (results.size() == topN-1 && maxQueueDepth == topN) { - // Last path -- don't bother w/ queue anymore: - queue = null; - } - // We take path and find its "0 output completion", // ie, ...
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
30,652
Whoa, was this opto breaking something? I guess if this final path is filtered out, we still need the queue? Have you run the suggest benchmarks to see if removing this opto hurt performance?
apache-lucene-solr
java
@@ -191,7 +191,7 @@ final class Collections { if (iterable instanceof Seq) { return (Seq<T>) iterable; } else { - return List.ofAll(iterable); + return Stream.ofAll(iterable); } } }
1
/* / \____ _ _ ____ ______ / \ ____ __ _______ * / / \/ \ / \/ \ / /\__\/ // \/ \ // /\__\ JΛVΛSLΛNG * _/ / /\ \ \/ / /\ \\__\\ \ // /\ \ /\\/ \ /__\ \ Copyright 2014-2016 Javaslang, http://javaslang.io * /___/\_/ \_/\____/\_/ \_/\__\/__/\__\_/ \_// \__/\_____/ ...
1
10,360
I'm not sure about this, please check the usages. It's only used currently to reverse it, maybe we should eliminate this method completely instead.
vavr-io-vavr
java
@@ -638,6 +638,18 @@ class AbstractBase extends AbstractActionController return $check->getTagSetting() !== 'disabled'; } + /** + * Are list tags enabled? + * + * @return bool + */ + protected function listTagsEnabled() + { + $check = $this->serviceLocator + ->...
1
<?php /** * VuFind controller base class (defines some methods that can be shared by other * controllers). * * PHP version 7 * * 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, *...
1
29,668
Since this is only used in the MyResearchController, does it need to be placed at the AbstractBase level?
vufind-org-vufind
php
@@ -55,7 +55,7 @@ type SelectorSpec struct { // +optional AnnotationSelectors map[string]string `json:"annotationSelectors,omitempty"` - // PodPhaseSelector is a set of condition of a pod at the current time. + // PhaseSelector is a set of condition of a pod at the current time. // supported value: Pending / Ru...
1
// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
1
12,900
why `PhaseSelector` ?
chaos-mesh-chaos-mesh
go
@@ -32,6 +32,8 @@ type rawConfig struct { RestrictedLicenses []string `json:"restricted_licenses"` // modules that get completely ignored during analysis + AllowlistedModules []string `json:"allowlisted_modules"` + // Deprecated. TODO(tbarrella): Clean up WhitelistedModules []string `json:"whitelisted_modules"`...
1
// Copyright Istio 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 wri...
1
8,953
Does` AllowlistedModules` have the same meaning of `WhitelistedModules`?
istio-tools
go
@@ -357,7 +357,7 @@ return [ 'ArithmeticError::getTrace' => ['array<int,array<string,mixed>>'], 'ArithmeticError::getTraceAsString' => ['string'], 'array_change_key_case' => ['array|false', 'input'=>'array', 'case='=>'int'], -'array_chunk' => ['array[]', 'input'=>'array', 'size'=>'int', 'preserve_keys='=>'bool'], +'...
1
<?php // phpcs:ignoreFile namespace Phan\Language\Internal; /** * Format * * '<function_name>' => ['<return_type>, '<arg_name>'=>'<arg_type>'] * alternative signature for the same function * '<function_name\'1>' => ['<return_type>, '<arg_name>'=>'<arg_type>'] * * A '&' in front of the <arg_name> means the arg i...
1
8,173
I missed the $preserve_keys=true case when adding this to Phan. For psalm, two separate signatures may make sense
vimeo-psalm
php
@@ -18,14 +18,19 @@ package org.apache.servicecomb.foundation.vertx.server; import java.net.InetSocketAddress; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.servicecomb.foundation.common.event.EventManager; import org.apache.servicecomb.foundation.common.net.URIEndpointObject; import org...
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,046
TcpServer will be created for each HighwayServerVerticle instance so the counter number in server is not correct.
apache-servicecomb-java-chassis
java
@@ -109,10 +109,14 @@ public class WindowsUtils { * quote (\"?) */ // TODO We should be careful, in case Windows has ~1-ified the executable name as well - pattern.append("\"?.*?\\\\"); - pattern.append(executable.getName()); + pattern.append("(\"?.*?\\\\)?"); + String execName = executable...
1
/* * 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 appli...
1
10,241
Why change this from a foreach? I can't see it gaining anything here and code styles shouldn't change just for the sake of it.
SeleniumHQ-selenium
py
@@ -116,6 +116,12 @@ func FindCgroupMountpoint(cgroupPath, subsystem string) (string, error) { return "", errUnified } + // If subsystem is empty it means that we are looking for the + // cgroups2 path + if len(subsystem) == 0 { + return hybridMountpoint, nil + } + // Avoid parsing mountinfo by trying the def...
1
package cgroups import ( "errors" "fmt" "os" "path/filepath" "strings" "sync" "syscall" securejoin "github.com/cyphar/filepath-securejoin" "github.com/moby/sys/mountinfo" "golang.org/x/sys/unix" ) // Code in this source file are specific to cgroup v1, // and must not be used from any cgroup v2 code. const...
1
17,854
I'd say "cgroup2 hybrid path" instead.
opencontainers-runc
go
@@ -84,15 +84,12 @@ module Bolt { 'name' => name, 'uri' => uri, - 'alias' => @target_alias, - 'config' => config.merge( - 'transport' => transport, - transport => options - ), + 'alias' => target_alias, + 'config' => Bolt::Util.deep_merge(con...
1
# frozen_string_literal: true require 'bolt/error' require 'bolt/util' module Bolt class Target2 attr_accessor :inventory # Target.new from a plan initialized with a hash def self.from_asserted_hash(hash) inventory = Puppet.lookup(:bolt_inventory) target = inventory.create_target_from_plan(...
1
13,102
I dont see a reason to print URI for `Target`. we do not expose that in inventory v1
puppetlabs-bolt
rb
@@ -131,9 +131,13 @@ type OpExpression struct { type ValueExpression struct { String string FString *FString - Int *struct { - Int int - } // Should just be *int, but https://github.com/golang/go/issues/23498 :( + // These are true if this represents one of the boolean singletons + True bool + False bool + ...
1
package asp import "fmt" // A FileInput is the top-level structure of a BUILD file. type FileInput struct { Statements []*Statement } // A Position describes a position in a source file. // All properties in Position are one(1) indexed type Position struct { Filename string Offset int Line int Column in...
1
9,953
Do we still need this?
thought-machine-please
go
@@ -79,9 +79,13 @@ type Application struct { type Gclient struct { // constant tracking-id used to send a hit trackID string + // anonymous client-id clientID string + // anonymous campaign source + campaignSource string + // https://developers.google.com/analytics/devguides/collection/protocol/v1/paramete...
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, softwa...
1
16,336
`campaignSource` is unused (from `structcheck`)
openebs-maya
go
@@ -63,6 +63,7 @@ public final class BaselineErrorProne implements Plugin<Project> { private static final Logger log = Logging.getLogger(BaselineErrorProne.class); public static final String EXTENSION_NAME = "baselineErrorProne"; private static final String ERROR_PRONE_JAVAC_VERSION = "9+181-r4173-1"; + ...
1
/* * (c) Copyright 2017 Palantir Technologies Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
1
8,687
we should discuss how to not hard-code this version
palantir-gradle-baseline
java
@@ -5,8 +5,14 @@ const isResumableError = require('./error').isResumableError; const MongoError = require('./core').MongoError; const ReadConcern = require('./read_concern'); const MongoDBNamespace = require('./utils').MongoDBNamespace; +const Cursor = require('./cursor'); +const relayEvents = require('./core/utils'...
1
'use strict'; const EventEmitter = require('events'); const isResumableError = require('./error').isResumableError; const MongoError = require('./core').MongoError; const ReadConcern = require('./read_concern'); const MongoDBNamespace = require('./utils').MongoDBNamespace; var cursorOptionNames = ['maxAwaitTimeMS', '...
1
15,933
do we have a doclet for this event?
mongodb-node-mongodb-native
js
@@ -35,10 +35,11 @@ if (isNodeProcess && process.platform === 'win32') { } // catching segfaults during testing can help debugging -if (isNodeProcess) { - const SegfaultHandler = node_require('segfault-handler'); - SegfaultHandler.registerHandler("crash.log"); -} +//uncomment to enable segfault handler +//if ...
1
//////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/li...
1
18,001
Why don't we want to catch segfaults by default?
realm-realm-js
js
@@ -137,6 +137,7 @@ namespace OpenTelemetry.Exporter.Zipkin return result; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The object should not be disposed")] private Task SendBatchActivityAsync(I...
1
// <copyright file="ZipkinExporter.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache...
1
16,574
You could probably dispose request & content if you `await` the SendAsync.
open-telemetry-opentelemetry-dotnet
.cs
@@ -35,6 +35,16 @@ class UtilsTest(ReusedSQLTestCase, SQLTestUtils): }, index=[0, 1, 3]) validate_arguments_and_invoke_function(pdf, self.to_html, pd.DataFrame.to_html, args) + def to_clipboard(self, sep=',', **kwargs): + args = locals() + + pdf = pd.DataFrame({ + 'a': [1...
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,893
why is this test case here? this file is for testing functionalities in utils.py
databricks-koalas
py
@@ -31,6 +31,15 @@ class AuthController < ApplicationController def do_user_auth(auth) sign_out user = User.from_oauth_hash(auth) + unless ENV["NO_WELCOME_EMAIL"] + send_welcome_mail(user) + end sign_in(user) end + + def send_welcome_mail(user) + if (Time.current - user.created_at) <...
1
class AuthController < ApplicationController skip_before_action :authenticate_user!, only: [:oauth_callback, :failure] skip_before_action :check_disabled_client def oauth_callback auth = request.env["omniauth.auth"] return_to_path = fetch_return_to_path do_user_auth(auth) session[:token] = auth.c...
1
16,620
why do we have an env var for this? not sure why we'd want to suppress welcome emails but not any others
18F-C2
rb
@@ -917,7 +917,13 @@ func (p *parser) parseStringExpression() *ast.StringExpression { } default: // TODO bad expression - return nil + loc := p.loc(pos, pos+token.Pos(len(lit))) + p.errs = append(p.errs, ast.Error{ + Msg: fmt.Sprintf("got unexpected token in string expression %s@%d:%d-%d:%d: %s", lo...
1
package parser import ( "fmt" "strconv" "strings" "github.com/influxdata/flux/ast" "github.com/influxdata/flux/internal/scanner" "github.com/influxdata/flux/internal/token" ) // Scanner defines the interface for reading a stream of tokens. type Scanner interface { // Scan will scan the next token. Scan() (po...
1
11,784
drop the todo?
influxdata-flux
go
@@ -383,7 +383,9 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { if (!IsDoorOpen() || (open_type == 58)) { if (!disable_timer) close_timer.Start(); - SetOpenState(true); + + if(strncmp(destination_zone_name, "NONE", strlen("NONE")) == 0) + SetOpenState(true); } else { close_timer.Disable...
1
/* EQEMu: Everquest Server Emulator Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) 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 is d...
1
11,028
Maybe use { } here like we are most other places now.
EQEmu-Server
cpp
@@ -96,6 +96,7 @@ class PartitionData return schema; } + @Override public Type getType(int pos) { return partitionType.fields().get(pos).type(); }
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
45,539
I want to get PartitionData field type, I don't know how to get it in other way.
apache-iceberg
java
@@ -31,6 +31,9 @@ type Balances interface { // A non-nil error means the lookup is impossible (e.g., if the database doesn't have necessary state anymore) Get(addr basics.Address, withPendingRewards bool) (basics.AccountData, error) + // GetEx is like Get(addr, false), but also loads specific creatable + GetEx(ad...
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,954
I think that a single `Get` method would be preferable, that would have the following parameters: Get(addr basics.Address, withPendingRewards bool, cidx basics.CreatableIndex, ctype basics.CreatableType) where we ignore cidx of -1, and adding support for ctype of "AssetParams" or something like that. (i.e. so that this...
algorand-go-algorand
go
@@ -1653,7 +1653,7 @@ char * ExHdfsScanTcb::extractAndTransformAsciiSourceToSqlRow(int &err, // for non-varchar, length of zero indicates a null value. // For all datatypes, HIVE_DEFAULT_NULL_STRING('\N') indicates a null value. if (((len == 0) && (tgtAttr && (NO...
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
16,713
This can handle the '\\' problem, but if (not possible) the user define '\\' as null, this logic will break. So here, it should be to compare the whole HIVE_DEFAULT_NULL_STRING, and make sure length is equal, as I understand. \N is NULL, but \NA is not NULL, what will happen if there is \NAA ?
apache-trafodion
cpp
@@ -0,0 +1,9 @@ +class ObservationPolicy + include ExceptionPolicy + + def can_destroy! + role = Role.new(@user, @record.proposal) + check(@user.id == @record.user_id || role.client_admin? || @user.admin?, + "Only the observer can delete themself") + end +end
1
1
13,704
Hmm, I would think that anyone who can edit the request should be able to delete the observation, in case they accidentally add the wrong person or something.
18F-C2
rb
@@ -4,13 +4,9 @@ class PublicPagesController < ApplicationController # GET template_index # ----------------------------------------------------- def template_index - template_ids = Template.where(org_id: Org.funder.pluck(:id), visibility: Template.visibilities[:publicly_visible]).valid.pluck(:dmptemplate_i...
1
class PublicPagesController < ApplicationController after_action :verify_authorized, except: [:template_index, :plan_index] # GET template_index # ----------------------------------------------------- def template_index template_ids = Template.where(org_id: Org.funder.pluck(:id), visibility: Template.visib...
1
17,326
I know we are doing this other places already. It would be good to refactor this and the paginable publicly_visible so that we are DRY. Can wait until after MVP though when we do general cleanup
DMPRoadmap-roadmap
rb
@@ -576,7 +576,12 @@ update_lookuptable_tls(dcontext_t *dcontext, ibl_table_t *table) * crashing or worse. */ state->table_space.table[table->branch_type].lookuptable = table->table; - state->table_space.table[table->branch_type].hash_mask = table->hash_mask; + /* Perform a Store-Release, which w...
1
/* ********************************************************** * Copyright (c) 2011-2020 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
20,520
I think this should read "is always observed before" or "is never observed after".
DynamoRIO-dynamorio
c
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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.
1
/* * Copyright 2002-2020 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
1
17,462
You might consider adding yourself as an author of the class.
spring-projects-spring-security
java
@@ -1065,7 +1065,8 @@ int ACTIVE_TASK::start(bool test) { // hook up stderr to a specially-named file // - (void) freopen(STDERR_FILE, "a", stderr); + if (freopen(STDERR_FILE, "a", stderr) == NULL) { + } // lower our priority if needed //
1
// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2020 University of California // // BOINC 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 Licens...
1
15,499
If this fails, then 'stderr' is not a valid file handler anymore, and then any further 'write' operations will fail. Maybe some handling of such situation should be added here?
BOINC-boinc
php
@@ -58,9 +58,12 @@ public class TracerTest { public void shouldBeAbleToCreateATracer() { List<SpanData> allSpans = new ArrayList<>(); Tracer tracer = createTracer(allSpans); + long timeStamp = 1593493828L; try (Span span = tracer.getCurrentContext().createSpan("parent")) { span.setAttribut...
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,762
Break out tests for events into their own tests rather than placing them in other ones. That makes it easier for us to figure out where problems lie and to do a TDD-driven implementation over new APIs.
SeleniumHQ-selenium
rb
@@ -262,8 +262,8 @@ class DHCPOptionsField(StrField): s += chr(len(oval)) s += oval - elif (type(o) is str and DHCPRevOptions.has_key(o) and - DHCPRevOptions[o][1] == None): + elif (type(o) is str and DHCPRevOptions.has_key(o) and + ...
1
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ DHCP (Dynamic Host Configuration Protocol) d BOOTP """ import struct from scapy.packet import * from scapy.fields i...
1
8,504
I think your indentation is wrong here.
secdev-scapy
py
@@ -63,7 +63,9 @@ type L3RouteResolver struct { blockToRoutes map[string]set.Set allPools map[string]model.IPPool workloadIDToCIDRs map[model.WorkloadEndpointKey][]cnet.IPNet + nodeToCIDRs map[string]set.Set useNodeResourceUpdates bool + routeSource string } ...
1
// Copyright (c) 2019-2020 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ap...
1
17,613
UT spotted that we weren't marking routes dirty when they targeted at Node and that node's IP changed. e.g., the case where a WEP appears in the syncer before the corresponding node does, so we don't know the node's IP. I added a new map to track the CIDRs for each node so that when the node IP changes we can mark thos...
projectcalico-felix
go
@@ -390,6 +390,14 @@ HELP def execute(options) if options[:mode] == 'plan' || options[:mode] == 'task' begin + if Gem.win_platform? + # Windows 'fix' for openssl behaving strangely. Prevents very slow operation + # of random_bytes later when establishing winrm connect...
1
require 'uri' require 'optparse' require 'benchmark' require 'json' require 'logging' require 'bolt/logger' require 'bolt/node' require 'bolt/version' require 'bolt/error' require 'bolt/executor' require 'bolt/outputter' require 'bolt/config' require 'io/console' module Bolt class CLIError < Bolt::Error attr_rea...
1
7,519
Given this will 'pause' bolt for a few seconds on older rubies, perhaps emit a debug message saying "Warming up OpenSSL" or something to that effect
puppetlabs-bolt
rb
@@ -85,6 +85,11 @@ class Package(object): self._package = package self._pkg_dir = pkg_dir self._path = path + self._format = None + + def set_format(self, pkgformat): + """Set the format. Only used when building a new package.""" + self._format = pkgformat def f...
1
from enum import Enum import json import os from shutil import copyfile import tempfile import zlib import pandas as pd import requests from six import iteritems try: import fastparquet except ImportError: fastparquet = None try: import pyarrow as pa from pyarrow import parquet except ImportError: ...
1
14,925
Initializing _format to None, but asserting that it's not None later, seems unnecessarily fragile. We shouldn't architect the package class to rely on classes or methods that use it (e.g., build). Let's at least set the format to the default in case we don't create all packages through build.py.
quiltdata-quilt
py
@@ -105,7 +105,7 @@ public interface WebDriver extends SearchContext { * @see org.openqa.selenium.WebDriver.Timeouts */ @Override - List<WebElement> findElements(By by); + <T extends WebElement> List<T> findElements(By by); /**
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,274
This change should also probably go into the corresponding method of the abstract By class?
SeleniumHQ-selenium
py
@@ -0,0 +1,8 @@ +<?php +namespace Psalm\Issue; + +class UnresolvableConstant extends CodeIssue +{ + public const ERROR_LEVEL = -1; + public const SHORTCODE = 303; +}
1
1
12,109
Should this be set to something else?
vimeo-psalm
php
@@ -0,0 +1 @@ +Hi
1
1
6,896
Whats up with this? It looks like this is rendered on purchases/new for subscribers, so it would result in a dead end?
thoughtbot-upcase
rb
@@ -1326,13 +1326,13 @@ class StoreOptions(object): return specs @classmethod - def propagate_ids(cls, obj, match_id, new_id, applied_keys): + def propagate_ids(cls, obj, match_id, new_id, applied_keys, backend=None): """ Recursively propagate an id through an object for componen...
1
""" Options and OptionTrees allow different classes of options (e.g. matplotlib-specific styles and plot specific parameters) to be defined separately from the core data structures and away from visualization specific code. There are three classes that form the options system: Cycle: Used to define infinite cycle...
1
20,025
Glad to see this generalized to support the backend argument.
holoviz-holoviews
py
@@ -1781,3 +1781,11 @@ func (a *WebAPI) GetInsightApplicationCount(ctx context.Context, req *webservice UpdatedAt: c.UpdatedAt, }, nil } + +func (a *WebAPI) ListDeploymentChains(ctx context.Context, req *webservice.ListDeploymentChainsRequest) (*webservice.ListDeploymentChainsResponse, error) { + return nil, stat...
1
// Copyright 2020 The PipeCD 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 agree...
1
23,380
`ctx` is unused in ListDeploymentChains
pipe-cd-pipe
go
@@ -154,7 +154,7 @@ func (e *Executor) reportRequiringApproval(ctx context.Context) { func (e *Executor) getMentionedAccounts(ctx context.Context, event model.NotificationEventType) ([]string, error) { ds, err := e.TargetDSP.GetReadOnly(ctx, e.LogPersister) if err != nil { - return nil, fmt.Errorf("failed to prep...
1
// Copyright 2020 The PipeCD 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 agree...
1
20,737
I'd say the format like `"xxx: %w"` is more convention when wrapping an error basically. You refered to anything like this?
pipe-cd-pipe
go
@@ -65,7 +65,7 @@ const ( endpoint = "https://127.0.0.1:2379" testTimeout = time.Second * 10 manageTickerTime = time.Second * 15 - learnerMaxStallTime = time.Minute * 1 + learnerMaxStallTime = time.Minute * 5 // defaultDialTimeout is intentionally short so that connections timeout within...
1
package etcd import ( "bytes" "context" "crypto/tls" "encoding/json" "fmt" "io/ioutil" "net/http" "net/url" "os" "path/filepath" "sort" "strconv" "strings" "time" "github.com/google/uuid" "github.com/gorilla/mux" "github.com/pkg/errors" certutil "github.com/rancher/dynamiclistener/cert" "github.com...
1
9,114
This seems relatively high, is it the recommended value from the etcd folks? Or is this debugging cruft?
k3s-io-k3s
go
@@ -10,11 +10,11 @@ import ( "google.golang.org/grpc/status" ) -type peerTrackerAttestor struct { +type PeerTrackerAttestor struct { Attestor attestor.Attestor } -func (a peerTrackerAttestor) Attest(ctx context.Context) ([]*common.Selector, error) { +func (a PeerTrackerAttestor) Attest(ctx context.Context) ([...
1
package endpoints import ( "context" attestor "github.com/spiffe/spire/pkg/agent/attestor/workload" "github.com/spiffe/spire/pkg/common/peertracker" "github.com/spiffe/spire/proto/spire/common" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) type peerTrackerAttestor struct { Attestor attestor...
1
17,680
This requires updating the name in the `endpoints` tests, please run `make test`.
spiffe-spire
go
@@ -37,6 +37,10 @@ std::vector<HostAddr> toHosts(const std::string& peersStr) { int main(int argc, char *argv[]) { folly::init(&argc, &argv, true); + if (FLAGS_data_path.empty()) { + LOG(FATAL) << "Meta Data Path should not empty"; + return EXIT_FAILURE; + } LOG(INFO) << "Starting Met...
1
/* Copyright (c) 2018 - present, VE Software Inc. All rights reserved * * This source code is licensed under Apache 2.0 License * (found in the LICENSE.Apache file in the root directory) */ #include "base/Base.h" #include <thrift/lib/cpp2/server/ThriftServer.h> #include "meta/MetaServiceHandler.h" #include "meta/...
1
15,662
LOG(FATAL) means coredump, LOG(ERROR) is better here.
vesoft-inc-nebula
cpp
@@ -533,13 +533,13 @@ nsCommandProcessor.prototype.execute = function(jsonCommandString, * Changes the context of the caller to the specified window. * @param {fxdriver.CommandResponse} response The response object to send the * command response in. - * @param {{name: string}} parameters The command parameter...
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
13,586
/javascript/firefox-driver is the Selenium implementation of a WebDriver for Firefox. Since it generally isn't W3C compatible, it shouldn't change. We can just drop this change.
SeleniumHQ-selenium
js
@@ -375,6 +375,12 @@ func UnmarshalService(in []byte) (interface{}, error) { m.BackendServiceConfig.Image.HealthCheck.applyIfNotSet(newDefaultContainerHealthCheck()) } return m, nil + case ScheduledJobType: + m := newDefaultScheduledJob() + if err := yaml.Unmarshal(in, m); err != nil { + return nil, fmt.E...
1
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Package manifest provides functionality to create Manifest files. package manifest import ( "errors" "fmt" "path/filepath" "strconv" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws...
1
15,001
It's a bit weird to have `svc.go` to include a `ScheduledJobType`...should we rename this file?
aws-copilot-cli
go
@@ -55,7 +55,7 @@ const licenseHeaderPrefix = "// The MIT License (MIT)" var ( // directories to be excluded - dirBlacklist = []string{"vendor/"} + dirBlacklist = []string{"tpb/"} // default perms for the newly created files defaultFilePerms = os.FileMode(0644) )
1
// Copyright (c) 2017 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
1
9,012
For some reason `protoc` doesn't copy license header from `proto` files to generated code. But this code will never be checked in, so it is ok.
temporalio-temporal
go
@@ -898,7 +898,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { PreparedQuery<TemporaryBasal> preparedQuery2 = queryBuilder2.prepare(); List<TemporaryBasal> trList2 = getDaoTemporaryBasal().query(preparedQuery2); - if (trList2.size() > 0) { + ...
1
package info.nightscout.androidaps.db; import android.content.Context; import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import androidx.annotation.Nullable; import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; import com.j256.ormlite.dao.CloseableIterator; import com....
1
31,963
I don't know what the implications of this change are for pumps other than the insight but i would add `|| trList2.get(0).pumpId == temporaryBasal.pumpId` in case we see the same pump event again, in order to not duplicate it in the database.
MilosKozak-AndroidAPS
java
@@ -29,8 +29,8 @@ type ( Address crypto.Digest ) -// ChecksumAddress is a representation of the short address with a checksum -type ChecksumAddress struct { +// checksumAddress is a representation of the short address with a checksum +type checksumAddress struct { shortAddress Address checksum []byte }
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,458
is there anything still referencing `checksumAddress` or can we just delete it?
algorand-go-algorand
go
@@ -18,6 +18,7 @@ var ( // ClusterDeployment conditions that could indicate provisioning problems with a cluster // First condition appearing True will be used in the metric labels. provisioningDelayCondition = [...]hivev1.ClusterDeploymentConditionType{ + hivev1.RequirementsMetCondition, hivev1.DNSNotReadyCo...
1
package metrics import ( "context" "time" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" hivev1 "github.com/openshift/hive/apis/hive/v1" controllerutils "github.com/openshift/hive/pkg/controller/utils"...
1
19,221
The reason I didn't suggest it before is because I didn't want alerts for every tried - but not updated provision, but I can see a value in it from OSD perspective
openshift-hive
go
@@ -2,8 +2,10 @@ if Rails.env.production? || Rails.env.staging? require 'rack/rewrite' Rails.configuration.middleware.insert_before(Rack::Runtime, Rack::Rewrite) do - r301 %r{.*}, "http://#{HOST}$&", if: Proc.new { |rack_env| - rack_env['SERVER_NAME'] != "#{HOST}" - } + r301( + %r{.*}, + ...
1
if Rails.env.production? || Rails.env.staging? require 'rack/rewrite' Rails.configuration.middleware.insert_before(Rack::Runtime, Rack::Rewrite) do r301 %r{.*}, "http://#{HOST}$&", if: Proc.new { |rack_env| rack_env['SERVER_NAME'] != "#{HOST}" } end end
1
10,331
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
thoughtbot-upcase
rb
@@ -61,8 +61,12 @@ func GroupActions(actions []*Action) (beforeGets, getList, writeList, afterGets agets := map[interface{}]*Action{} cgets := map[interface{}]*Action{} writes := map[interface{}]*Action{} + var nilkeys []*Action for _, a := range actions { - if a.Kind == Get { + if a.Key == nil { + // Proba...
1
// Copyright 2019 The Go Cloud Development Kit Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
1
19,875
I believe Key is not necessarily nil, it could be empty string. Probably better check a.Kind == Create
google-go-cloud
go
@@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } } - public Task WriteAsync<T>(Func<PipeWriter, T, long> callback, T state) + public Task WriteAsync<T>(Func<PipeWriter, T, long> callback, T state, CancellationToken cancellationToken) { ...
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.Buffers; using System.IO.Pipelines; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft....
1
16,464
This is only used for headers and therefore isn't used.
aspnet-KestrelHttpServer
.cs
@@ -15,11 +15,13 @@ import ( // ProviderCommand defines the shell command to be run for one of the commands (db pull, etc.) type ProviderCommand struct { - Command string `yaml:"command"` - Service string `yaml:"service,omitempty"` + Command string `yaml:"command"` + Service string `yaml:"service,omitempty"` ...
1
package ddevapp import ( "github.com/drud/ddev/pkg/output" "os" "path/filepath" "fmt" "github.com/drud/ddev/pkg/fileutil" "github.com/drud/ddev/pkg/util" "gopkg.in/yaml.v2" ) // ProviderCommand defines the shell command to be run for one of the commands (db pull, etc.) type ProviderCommand struct { Command...
1
15,667
Wouldn't it make sense to add a files_import_command and a db_import_command, which could be empty? I guess that leads to potential backward-compatibility problems, but it's worth thinking about. Perhaps add an import-api version to solve that? Overall, I think the actual db import logic and files import logic should b...
drud-ddev
php
@@ -0,0 +1,15 @@ +// DO NOT EDIT: This file is autogenerated via the builtin command. + +package csv + +import ast "github.com/influxdata/flux/ast" + +var FluxTestPackages = []*ast.Package{&ast.Package{ + BaseNode: ast.BaseNode{ + Errors: nil, + Loc: nil, + }, + Files: []*ast.File{}, + Package: "csv_test", + Pat...
1
1
15,740
Why do we have this here? I'm not concerned about it really, just curious.
influxdata-flux
go
@@ -28,11 +28,11 @@ import ( type DeltaAction uint64 const ( - // SetBytesAction indicates that a TEAL byte slice should be stored at a key - SetBytesAction DeltaAction = 1 - // SetUintAction indicates that a Uint should be stored at a key - SetUintAction DeltaAction = 2 + SetUintAction DeltaAction = 1 + + // Set...
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,833
@justicz Why are these switched here?
algorand-go-algorand
go
@@ -0,0 +1,7 @@ +describe 'GET /help' do + it "displays successfully" do + get '/help' + expect(response.status).to eq(200) + expect(response.body).to include('FAQ') + end +end
1
1
13,289
Maybe verify that an anchor was created -- that the markdown was processed?
18F-C2
rb
@@ -64,7 +64,7 @@ public abstract class TwoPhaseIterator { TwoPhaseIteratorAsDocIdSetIterator(TwoPhaseIterator twoPhaseIterator) { this.twoPhaseIterator = twoPhaseIterator; - this.approximation = twoPhaseIterator.approximation; + this.approximation = twoPhaseIterator.approximation(); } ...
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
31,940
Is this just a minor improvement or is it necessary? If just some minor improvement, I recommend you don't touch Lucene in a Solr PR.
apache-lucene-solr
java
@@ -63,7 +63,4 @@ public interface ReadOnlyPDClient { /** Close underlining resources */ void close() throws InterruptedException; - - /** Get associated session * @return the session associated to client */ - TiSession getSession(); }
1
/* * Copyright 2017 PingCAP, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
1
9,203
why delete this method?
pingcap-tispark
java
@@ -15,13 +15,17 @@ package com.google.api.codegen.transformer; import com.google.api.codegen.config.MethodContext; +import com.google.api.codegen.config.OutputContext; import com.google.api.codegen.metacode.InitCodeNode; import com.google.api.codegen.viewmodel.CallingForm; import com.google.api.codegen.viewmode...
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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
1
29,015
Does this transform only the `MethodContext`, or also the `OutputContext`? (Looking at the other files, I gather it's the latter.) Might be helpful to mention that here.
googleapis-gapic-generator
java
@@ -1,15 +1,17 @@ # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2009-2018 NV Access Limited, Aleksey Sadovoy, James Teh, Joseph Lee, Tuukka Ojala +# Copyright (C) 2009-2020 NV Access Limited, Aleksey Sadovoy, James Teh, Joseph Lee, Tuukka Ojala # This file may be used under the terms of the GNU General...
1
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2009-2018 NV Access Limited, Aleksey Sadovoy, James Teh, Joseph Lee, Tuukka Ojala # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.htmlimport appModul...
1
29,361
Could you please clean-up this line while at it?
nvaccess-nvda
py
@@ -50,6 +50,11 @@ type PubSubSpec struct { // This brings in CloudEventOverrides and Sink. duckv1.SourceSpec `json:",inline"` + // ServiceAccount is the GCP service account which has required permissions to poll from a Cloud Pub/Sub subscription. + // If not specified, defaults to use secret. + // +optional + Se...
1
/* Copyright 2019 The Knative 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
11,100
no need to use a pointer. Just string and check for != ""
google-knative-gcp
go
@@ -133,7 +133,9 @@ public class RestServerVerticle extends AbstractVerticle { serverOptions.setIdleTimeout(TransportConfig.getConnectionIdleTimeoutInSeconds()); serverOptions.setCompressionSupported(TransportConfig.getCompressed()); serverOptions.setMaxHeaderSize(TransportConfig.getMaxHeaderSize()); - +...
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
9,300
this means h2 mode? but how h2c can work?
apache-servicecomb-java-chassis
java
@@ -1,9 +1,9 @@ # -*- coding: UTF-8 -*- -#appModules/explorer.py -#A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2019 NV Access Limited, Joseph Lee, Łukasz Golonka -#This file is covered by the GNU General Public License. -#See the file COPYING for more details. +# appModules/explorer.py +# A part of ...
1
# -*- coding: UTF-8 -*- #appModules/explorer.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2006-2019 NV Access Limited, Joseph Lee, Łukasz Golonka #This file is covered by the GNU General Public License. #See the file COPYING for more details. """App module for Windows Explorer (aka Windows shell...
1
29,558
This line should not be there
nvaccess-nvda
py
@@ -120,7 +120,12 @@ func (t *trie) Start(ctx context.Context) error { return t.dao.Commit(t.cb) } -func (t *trie) Stop(ctx context.Context) error { return t.lifecycle.OnStop(ctx) } +func (t *trie) Stop(ctx context.Context) error { + t.mutex.Lock() + defer t.mutex.Unlock() + + return t.lifecycle.OnStop(ctx) +} ...
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
13,119
why do we need lock here? if needed, then we also need to lock in Start()?
iotexproject-iotex-core
go
@@ -415,6 +415,8 @@ void ProtocolGame::parsePacket(NetworkMessage& msg) } } + addGameTask(&Game::playerExecuteParsePacketEvent, player->getID(), recvbyte, new NetworkMessage(msg)); + switch (recvbyte) { case 0x14: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::logout, getThis(), true, false))); br...
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,115
this should be on default-switch, uhm? else you will handle twice (c++ and lua). I'm just saying...
otland-forgottenserver
cpp
@@ -60,7 +60,7 @@ public class Program // turn off the above default. i.e any // instrument which does not match any views // gets dropped. - // .AddView(instrumentName: "*", new MetricStreamConfiguration() { Aggregation = Aggregation.Drop }) + // .AddView(in...
1
// <copyright file="Program.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/lic...
1
22,419
unrelated minor fix
open-telemetry-opentelemetry-dotnet
.cs
@@ -19,6 +19,7 @@ module Travis def setup super cmd "nvm use #{config[:node_js]}" + cmd "npm config set spin false", echo: false if npm_should_disable_strict_ssl? cmd 'echo "### Disabling strict SSL ###"' cmd 'npm conf set strict-ssl false'
1
module Travis module Build class Script class NodeJs < Script DEFAULTS = { :node_js => '0.10' } def cache_slug super << "--node-" << config[:node_js].to_s end def export super config[:node_js] ||= config[:nodejs] # some old pr...
1
11,747
can you add `, echo: false` to the end of this as well. I don't think we need to echo this to the log. You might need to update the spec as well.
travis-ci-travis-build
rb