hash
stringlengths
40
40
diff
stringlengths
172
2.63k
message
stringlengths
12
593
project
stringlengths
7
65
split
stringclasses
1 value
diff_languages
stringclasses
54 values
6b91fd4d6d8e275d3e8e0c01ca68a84944885c41
diff --git a/src/foremast/utils/tasks.py b/src/foremast/utils/tasks.py index <HASH>..<HASH> 100644 --- a/src/foremast/utils/tasks.py +++ b/src/foremast/utils/tasks.py @@ -125,7 +125,7 @@ def check_task(taskid, timeout=DEFAULT_TASK_TIMEOUT, wait=2): wait=wait, exceptions=(AssertionError, ValueError), ) except ValueError: - raise SpinnakerTaskInconclusiveError('Task failed to complete in time: {0}'.format(taskid)) + raise SpinnakerTaskInconclusiveError('Task failed to complete in {0} seconds: {1}'.format(timeout, taskid)) def wait_for_task(task_data):
fix: Include seconds for timeout failure
foremast_foremast
train
py
8b27cfd21398ddf6bffcd094db9dbad370ea104d
diff --git a/lib/api-client/resources/process-definition.js b/lib/api-client/resources/process-definition.js index <HASH>..<HASH> 100644 --- a/lib/api-client/resources/process-definition.js +++ b/lib/api-client/resources/process-definition.js @@ -278,17 +278,17 @@ var ProcessDefinition = AbstractClientResource.extend( var queryParams = '?'; var param = 'cascade'; - if (data[param]) { - queryParams += param + '=true'; + if (typeof data[param] === 'boolean') { + queryParams += param + '=' + data[param]; } param = 'skipCustomListeners'; - if (data[param]) { + if (typeof data[param] === 'boolean') { if (queryParams.length > 1) { queryParams += '&'; } - queryParams += param + '=true'; + queryParams += param + '=' + data[param]; } return this.http.del(this.path +'/'+ pointer + queryParams, {
fix(api): remove hard coded values for skipCustomListeners and cascade when deleting process definitions
camunda_camunda-bpm-sdk-js
train
js
23e0ff224f4d4d9b681c60bd164a1140184d5d20
diff --git a/test/unit/config-get-env-test.js b/test/unit/config-get-env-test.js index <HASH>..<HASH> 100644 --- a/test/unit/config-get-env-test.js +++ b/test/unit/config-get-env-test.js @@ -23,7 +23,7 @@ test('ENV config', (group) => { }) group.test('TRAVIS_JOB_NUMBER', (t) => { - var clock = lolex.install(45678, ['Date']) + var clock = lolex.install({now: 45678, toFake: ['Date']}) simple.mock(process.env, 'TRAVIS_JOB_NUMBER', '123') const config = getEnvConfig() clock.uninstall() @@ -36,7 +36,7 @@ test('ENV config', (group) => { }) group.test('no TRAVIS_JOB_NUMBER', (t) => { - var clock = lolex.install(45678, ['Date']) + var clock = lolex.install({now: 45678, toFake: ['Date']}) simple.mock(process.env, 'TRAVIS_JOB_NUMBER', '') const config = getEnvConfig() clock.uninstall()
test: adapt for lolex@2
gr2m_selsa
train
js
b4d755af88db7763278d56f33a0157e2009fa725
diff --git a/src/shared/util/stat-utils.js b/src/shared/util/stat-utils.js index <HASH>..<HASH> 100644 --- a/src/shared/util/stat-utils.js +++ b/src/shared/util/stat-utils.js @@ -3,6 +3,11 @@ export const ERROR_CHUNK_MODULES = `Unfortunately, it looks like your stats don' export function getAssetsData(assets, chunks) { + let chunksMap = {}; + chunks.forEach(chunk => { + chunksMap[chunk.id] = chunk; + }); + return assets .filter(asset => asset.name.indexOf('.js') === asset.name.length - 3) .map(asset => { @@ -10,7 +15,7 @@ export function getAssetsData(assets, chunks) { return { ...asset, - chunk: chunks[chunkIndex] + chunk: chunksMap[chunkIndex] }; }); }
fix: "cannot read property 'modules' of undefined" in some stats.json files fixes #<I>
chrisbateman_webpack-visualizer
train
js
d57660a16bf9d5baa1c4abf4e412d6b442ec61c9
diff --git a/opaque_keys/edx/django/models.py b/opaque_keys/edx/django/models.py index <HASH>..<HASH> 100644 --- a/opaque_keys/edx/django/models.py +++ b/opaque_keys/edx/django/models.py @@ -105,7 +105,7 @@ class OpaqueKeyField(CreatorMixin, CharField): return None error_message = f"{value} is not an instance of str or {self.KEY_CLASS}" - assert isinstance(value, (str,) if self.KEY_CLASS is None else (str, self.KEY_CLASS), error_message) + assert isinstance(value, (str,) if self.KEY_CLASS is None else (str, self.KEY_CLASS)), error_message if value == '': # handle empty string for models being created w/o fields populated return None
chore: pylint balks at concatenating None to type in isistance() arg Move improperly placed parenthesis in modified is instance call
edx_opaque-keys
train
py
f981c97758e14fa03c7dc0990e3527f762183a07
diff --git a/src/component/axis/CartesianAxisView.js b/src/component/axis/CartesianAxisView.js index <HASH>..<HASH> 100644 --- a/src/component/axis/CartesianAxisView.js +++ b/src/component/axis/CartesianAxisView.js @@ -118,7 +118,7 @@ var CartesianAxisView = AxisView.extend({ // Simple optimization // Batching the lines if color are the same var lineStyle = lineStyleModel.getLineStyle(); - for (var i = 0; i < ticksCoords.length; i++) { + for (var i = 1; i < ticksCoords.length; i++) { var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); if (isHorizontal) {
fix: remove splitLine at axis position, fix #<I>
apache_incubator-echarts
train
js
5c09563fa58889deb007b8aa77de305b93a21edc
diff --git a/src/Keboola/Json/Parser.php b/src/Keboola/Json/Parser.php index <HASH>..<HASH> 100755 --- a/src/Keboola/Json/Parser.php +++ b/src/Keboola/Json/Parser.php @@ -98,9 +98,9 @@ class Parser { /** * @param Logger $logger * @param array $struct should contain an array with previously cached results from analyze() calls (called automatically by process()) - * @param int $analyzeRows determines, how many rows of data (counting only the "root" level of each Json) will be analyzed [default 500, -1 for infinite] + * @param int $analyzeRows determines, how many rows of data (counting only the "root" level of each Json) will be analyzed [default -1 for infinite/all] */ - public function __construct(Logger $logger, array $struct = array(), $analyzeRows = 500) + public function __construct(Logger $logger, array $struct = array(), $analyzeRows = -1) { $this->struct = $struct; $this->analyzeRows = $analyzeRows;
feat: Analyze all data by default
keboola_php-jsonparser
train
php
ab4e1d96efc4896197dbd800a2e263038e1be89a
diff --git a/Plugin/Load.php b/Plugin/Load.php index <HASH>..<HASH> 100644 --- a/Plugin/Load.php +++ b/Plugin/Load.php @@ -13,9 +13,11 @@ class Load * Load plugins * * @param bool $isConsole + * @param bool $start + * @param mixed $response * @return void */ - public static function plugins(bool $isConsole) + public static function plugins(bool $isConsole, bool $start = true, $response = null) { $plugins = config('app.plugins'); @@ -39,8 +41,14 @@ class Load if (!Validate::check($extension, $class_info)) return; - $extension->instance($extendable, $DIR); - $extension->boot($extendable); + if ($start) { + $extension->instance($extendable, $DIR); + $extension->boot($extendable); + } else { + if ($extension->exit($response)) { + continue; + } + } } } }
feat: allow plugin to get executed on boot and on exit
modulusphp_framework
train
php
d18a8b8caa54f645aab269b01a36faaceb76a802
diff --git a/src/lib/isPostalCode.js b/src/lib/isPostalCode.js index <HASH>..<HASH> 100644 --- a/src/lib/isPostalCode.js +++ b/src/lib/isPostalCode.js @@ -30,7 +30,7 @@ const patterns = { ID: fiveDigit, IE: /^[A-z]\d[\d|w]\s\w{4}$/i, IL: fiveDigit, - IN: sixDigit, + IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/, IS: threeDigit, IT: fiveDigit, JP: /^\d{3}\-\d{4}$/, diff --git a/test/validators.js b/test/validators.js index <HASH>..<HASH> 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6744,6 +6744,29 @@ describe('Validators', () => { ], }, { + locale: 'IN', + valid: [ + '364240', + '360005', + ], + invalid: [ + '123', + '012345', + '011111', + '101123', + '291123', + '351123', + '541123', + '551123', + '651123', + '661123', + '861123', + '871123', + '881123', + '891123', + ], + }, + { locale: 'BG', valid: [ '1000',
fix(isPostalCode): postal code validation fix for locale IN (#<I>) * postal code validation fix for locale IN * regex updated
chriso_validator.js
train
js,js
f7ba07bfdee7f682529015effaec5d15680b38df
diff --git a/coveralls/api.py b/coveralls/api.py index <HASH>..<HASH> 100644 --- a/coveralls/api.py +++ b/coveralls/api.py @@ -128,6 +128,10 @@ class Coveralls(object): if service_name: self.config['service_name'] = service_name + flag_name = os.environ.get('COVERALLS_FLAG_NAME') + if flag_name: + self.config['flag_name'] = flag_name + def load_config_from_file(self): try: with open(os.path.join(os.getcwd(),
feat(flags): add ability to add named job (#<I>)
coveralls-clients_coveralls-python
train
py
0c48e46fece0687b484bbbb361222221b154bd06
diff --git a/protocol-designer/src/components/BatchEditForm/BatchEditMoveLiquid.js b/protocol-designer/src/components/BatchEditForm/BatchEditMoveLiquid.js index <HASH>..<HASH> 100644 --- a/protocol-designer/src/components/BatchEditForm/BatchEditMoveLiquid.js +++ b/protocol-designer/src/components/BatchEditForm/BatchEditMoveLiquid.js @@ -15,7 +15,6 @@ import { CheckboxRowField, DelayFields, FlowRateField, - TextField, TipPositionField, WellOrderField, } from '../StepEditForm/fields' @@ -146,17 +145,6 @@ const SourceDestBatchEditMoveLiquidFields = (props: {| /> </CheckboxRowField> )} - <CheckboxRowField - {...propsForFields[addFieldNamePrefix('airGap_checkbox')]} - label={i18n.t('form.step_edit_form.field.airGap.label')} - className={styles.small_field} - > - <TextField - {...propsForFields[addFieldNamePrefix('airGap_volume')]} - className={styles.small_field} - units={i18n.t('application.units.microliter')} - /> - </CheckboxRowField> </FormColumn> ) }
fix(protocol-designer): remove air gap fields from batch edit form (#<I>) * fix(protocol-designer): remove air gap fields from batch edit form
Opentrons_opentrons
train
js
b34fd15aefb35e594a43cf38b779e861d7a0f87d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,7 @@ module.exports = { } this.options.babel = { + loose: true, postTransformPlugins: [StripClassCallCheck] };
chore(babel): Switch to loose mode for perf (#<I>)
html-next_vertical-collection
train
js
ad5a1fec88d529b972dde290a071a4d1696d5c8e
diff --git a/src/Redirect.js b/src/Redirect.js index <HASH>..<HASH> 100644 --- a/src/Redirect.js +++ b/src/Redirect.js @@ -10,6 +10,8 @@ * governing permissions and limitations under the License. */ +const DEFAULT_TYPE = 'permanent'; + /** * Defines a redirect rule */ @@ -17,6 +19,7 @@ class Redirect { constructor(cfg) { this._from = new RegExp(cfg.from); this._to = cfg.to; + this._type = cfg.type; } get from() { @@ -27,11 +30,20 @@ class Redirect { return this._to; } + get type() { + return this._type || DEFAULT_TYPE; + } + toJSON() { - return { + const retval = { from: this.from, to: this.to, }; + + return this._type ? { + ...retval, + type: this.type, + } : retval; } }
feat(redirects): add redirect type
adobe_helix-shared
train
js
34fc05d4d8f1e127423789752cb6b51c14680d87
diff --git a/core/src/elements/ons-dialog/index.js b/core/src/elements/ons-dialog/index.js index <HASH>..<HASH> 100644 --- a/core/src/elements/ons-dialog/index.js +++ b/core/src/elements/ons-dialog/index.js @@ -64,8 +64,8 @@ class DialogElement extends BaseElement { createdCallback() { if (!this.hasAttribute('_compiled')) { + ons._prepareAutoStyling(this); this._compile(); - ModifierUtil.initModifier(this, scheme); this.setAttribute('_compiled', ''); } @@ -106,6 +106,8 @@ class DialogElement extends BaseElement { this._mask.style.zIndex = 20000; this.setAttribute('no-status-bar-fill', ''); + + ModifierUtil.initModifier(this, scheme); } /**
feat(ons-dialog): Automatic Styling.
OnsenUI_OnsenUI
train
js
e7019c6871b5bca14dc53281c06d658624be91e4
diff --git a/src/Time.php b/src/Time.php index <HASH>..<HASH> 100644 --- a/src/Time.php +++ b/src/Time.php @@ -21,13 +21,7 @@ class Time { $now = new \DateTime('now', $tz); } - $mins = $now->getOffset() / 60; - $sgn = ($mins < 0 ? -1 : 1); - $mins = abs($mins); - $hrs = floor($mins / 60); - $mins -= $hrs * 60; - - return sprintf('%+d:%02d', $hrs * $sgn, $mins); + return $now->format('P'); } } # class
refactor: improved Time::timezoneOffset
freialib_hlin.tools
train
php
713da5ac7b997264979b44f6125e333f43c11003
diff --git a/test/k8sT/DatapathConfiguration.go b/test/k8sT/DatapathConfiguration.go index <HASH>..<HASH> 100644 --- a/test/k8sT/DatapathConfiguration.go +++ b/test/k8sT/DatapathConfiguration.go @@ -140,6 +140,17 @@ var _ = Describe("K8sDatapathConfig", func() { Expect(testPodConnectivityAcrossNodes(kubectl)).Should(BeTrue(), "Connectivity test between nodes failed") cleanService() }) + + It("Check vxlan connectivity with per endpoint routes", func() { + Skip("Encapsulation mode is not supported with per-endpoint routes") + + deployCilium([]string{ + "--set global.autoDirectNodeRoutes=true", + }) + Expect(testPodConnectivityAcrossNodes(kubectl)).Should(BeTrue(), "Connectivity test between nodes failed") + cleanService() + }) + }) Context("DirectRouting", func() {
test: Add disabled test for tunnel+endpointRoutes
cilium_cilium
train
go
fedd136791d8b066f34a09d0476aef216f6ef2ad
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -27,9 +27,9 @@ export default function Navaid(base, on404) { $.run = function (uri) { var i=0, params={}, arr, obj; - for (; i < routes.length;) { - obj = routes[i++]; - if (arr = obj.pattern.exec(fmt(uri || location.pathname))) { + uri = fmt(uri || location.pathname); + for (; i < routes.length; i++) { + if (arr = (obj=routes[i]).pattern.exec(uri)) { for (i=0; i < obj.keys.length;) params[obj.keys[i]]=arr[++i] || null; handlers[obj.route](params); // todo loop? return $;
fix: revert `uri` inlining
lukeed_navaid
train
js
2da1c51e2def1d9dfad36904f81a6808eca6526a
diff --git a/src/router.js b/src/router.js index <HASH>..<HASH> 100644 --- a/src/router.js +++ b/src/router.js @@ -1,6 +1,6 @@ import { parse } from 'url' import wechat from './wechat' -import { encode } from './utils' +import { encode, globals } from './utils' class Router { _tabs = [] @@ -53,7 +53,7 @@ export default function createRouterMixin (config) { if (this && this.route) { return this.route } - let pages = getCurrentPages() + let pages = globals.getCurrentPages() if (pages) { let last = pages[pages.length - 1] if (last && last.route) { diff --git a/src/utils.js b/src/utils.js index <HASH>..<HASH> 100644 --- a/src/utils.js +++ b/src/utils.js @@ -7,6 +7,7 @@ const commaRE = /%2C/g export const globals = { global: this || global, wx, + getCurrentPages, } export function parseTabsFromGlobal (global) {
refactor: get `getCurrentPages` from globals container
tinajs_tina-router
train
js,js
f4729759f600372455f062c75859f084e23a5d78
diff --git a/packages/discord.js/src/structures/EmbedBuilder.js b/packages/discord.js/src/structures/EmbedBuilder.js index <HASH>..<HASH> 100644 --- a/packages/discord.js/src/structures/EmbedBuilder.js +++ b/packages/discord.js/src/structures/EmbedBuilder.js @@ -2,6 +2,7 @@ const { EmbedBuilder: BuildersEmbed, isJSONEncodable } = require('@discordjs/builders'); const Transformers = require('../util/Transformers'); +const Util = require('../util/Util'); class EmbedBuilder extends BuildersEmbed { constructor(data) { @@ -19,6 +20,18 @@ class EmbedBuilder extends BuildersEmbed { } return new this(other); } + + /** + * Sets the color of this embed + * @param {?ColorResolvable} color The color of the embed + * @returns {Embed} + */ + setColor(color) { + if (color === null) { + return super.setColor(null); + } + return super.setColor(Util.resolveColor(color)); + } } module.exports = EmbedBuilder;
refactor(EmbedBuilder): allow hex strings in setColor (#<I>) * refactor(EmbedBuilder): allow hex strings in setColor * Apply suggestions from code review
discordjs_discord.js
train
js
7c5fd5234244cc81a7c18ce6dca0bafd5f429b1a
diff --git a/lib/browser/managed-upload.js b/lib/browser/managed-upload.js index <HASH>..<HASH> 100644 --- a/lib/browser/managed-upload.js +++ b/lib/browser/managed-upload.js @@ -303,10 +303,25 @@ WebFileReadStream.prototype._read = function _read(size) { } }; +function getBuffer(file) { + // Some browsers do not support Blob.prototype.arrayBuffer, such as IE + if (file.arrayBuffer) return file.arrayBuffer(); + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = function (e) { + resolve(e.target.result); + }; + reader.onerror = function (e) { + reject(e); + }; + reader.readAsArrayBuffer(file); + }); +} + proto._createBuffer = async function _createBuffer(file, start, end) { if (isBlob(file) || isFile(file)) { const _file = file.slice(start, end); - const fileContent = await _file.arrayBuffer(); + const fileContent = await getBuffer(_file); return Buffer.from(fileContent); } else if (isBuffer(file)) { return file.subarray(start, end);
fix: use arrayBuffer first, fall back to FileReader if it does not work (#<I>)
ali-sdk_ali-oss
train
js
f0487f6ced32c55fae9439e2aca74ab975408aa1
diff --git a/tests/packages/test_locker.py b/tests/packages/test_locker.py index <HASH>..<HASH> 100644 --- a/tests/packages/test_locker.py +++ b/tests/packages/test_locker.py @@ -637,6 +637,8 @@ lib-b = [] create_dependency_patch.assert_called_once_with( "lib-b", {"develop": True, "path": "../libB"}, root_dir=mocker.ANY ) - root_dir = create_dependency_patch.call_args.kwargs["root_dir"] + call_kwargs = create_dependency_patch.call_args[1] + root_dir = call_kwargs["root_dir"] assert root_dir.match("*/lib/libA") - assert root_dir.is_relative_to(locker.lock.path.parent.resolve()) + # relative_to raises an exception if not relative - is_relative_to comes in py3.9 + assert root_dir.relative_to(locker.lock.path.parent.resolve()) is not None
test: fix tests for for older versions of python
sdispater_poetry
train
py
4305166186fa3e7b12ef212adc49600cb075182d
diff --git a/website/.storybook/main.js b/website/.storybook/main.js index <HASH>..<HASH> 100644 --- a/website/.storybook/main.js +++ b/website/.storybook/main.js @@ -10,4 +10,10 @@ module.exports = { 'storybook-addon-root-attribute/register', ], framework: '@storybook/react', + staticDirs: [ + { + from: '../static', + to: '/', + }, + ], }; diff --git a/website/.storybook/preview.js b/website/.storybook/preview.js index <HASH>..<HASH> 100644 --- a/website/.storybook/preview.js +++ b/website/.storybook/preview.js @@ -1,4 +1,6 @@ import '../src/css/custom.css'; +import '../node_modules/infima/dist/css/default/default.css'; +import '../node_modules/@docusaurus/theme-classic/lib/admonitions.css'; import { withRootAttribute } from 'storybook-addon-root-attribute'; export const parameters = {
chore(storybook): wire storybook up with docusaurus
Unleash_unleash
train
js,js
78cfc65c713bc8cd38a57d0d5e62225d28788f1c
diff --git a/lib/BaseWidget.js b/lib/BaseWidget.js index <HASH>..<HASH> 100644 --- a/lib/BaseWidget.js +++ b/lib/BaseWidget.js @@ -13,6 +13,7 @@ function BaseWidget (opts) { opts = _(baseWidgetOpts).merge(opts || {}).toObject(); if (!opts.screen) opts.screen = (opts.parent || {}).screen; + if (!opts.parent) opts.parent = opts.screen; if (self instanceof BaseWidget) blessed.Box.call(self, opts); // this should not be called if an element inherits from built-in blessed classes self.focusable = opts.focusable; @@ -22,6 +23,7 @@ function BaseWidget (opts) { .return(self) .tap(function () { util.logger.debug(util.typeOf(self), 'ready'); }); } +BaseWidget.blessed = blessed; BaseWidget.prototype.__proto__ = blessed.Box.prototype; BaseWidget.prototype.walkDepthFirst = function (direction, after, fn) {
feat(opts): if opts.parent doesn’t exist, use opts.screen; export BaseWidget’s copy of blessed as BaseWidget.blessed
slap-editor_base-widget
train
js
36d43f249b46bb85c417575518fd71393139cecc
diff --git a/test/tests/functional/pool_tests.js b/test/tests/functional/pool_tests.js index <HASH>..<HASH> 100644 --- a/test/tests/functional/pool_tests.js +++ b/test/tests/functional/pool_tests.js @@ -39,7 +39,7 @@ describe('Pool tests', function() { } }); - it.only('Should only listen on connect once', { + it('Should only listen on connect once', { metadata: { requires: { topology: 'single' } }, test: function(done) {
test(pool): remove .only in test came in #<I>
mongodb-js_mongodb-core
train
js
af157c4b9a5c3036e6f67bf10c7ae8cff8e214a7
diff --git a/packages/www/test/02_import-all.js b/packages/www/test/02_import-all.js index <HASH>..<HASH> 100644 --- a/packages/www/test/02_import-all.js +++ b/packages/www/test/02_import-all.js @@ -1 +1,2 @@ +import "../src/public/data/selectors"; import "../src/public/routes";
chore(www): Just bring in `selectors` for coverage purposes. Unused sure, but I'm sure I'll need it eventually...
randytarampi_me
train
js
3738f52138e03b953190c801ff44959db782f720
diff --git a/src/protocol/png.js b/src/protocol/png.js index <HASH>..<HASH> 100644 --- a/src/protocol/png.js +++ b/src/protocol/png.js @@ -35,7 +35,7 @@ define(function(require, exports, module) { return Promise(function (resolve, reject) { var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('GET', info.url, true); + xmlHttp.open('GET', info.url + '?_=' + Date.now(), true); xmlHttp.responseType = 'blob'; xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
fix(png): add query to disable cache on ajax cors
fex-team_kityminder-core
train
js
45176123fad619e984a639fc5388430bdc1a3174
diff --git a/test/aio/test_workspace.py b/test/aio/test_workspace.py index <HASH>..<HASH> 100644 --- a/test/aio/test_workspace.py +++ b/test/aio/test_workspace.py @@ -4,27 +4,26 @@ import pytest import asyncio from i3ipc import Event +events = asyncio.Queue() class TestWorkspace(IpcTest): - event = None - def on_workspace(self, i3, e): - TestWorkspace.event = e - i3.main_quit() + async def on_workspace(self, i3, e): + await events.put(e) @pytest.mark.asyncio async def test_workspace(self, i3): await i3.command('workspace 0') await i3.subscribe([Event.WORKSPACE]) - i3.on(Event.WORKSPACE_INIT, self.on_workspace) - asyncio.ensure_future(i3.command('workspace 12')) - await i3.main() + i3.on(Event.WORKSPACE_FOCUS, self.on_workspace) + await i3.command('workspace 12') + e = await events.get() + workspaces = await i3.get_workspaces() assert len(workspaces) == 1 ws = workspaces[0] assert ws.name == '12' - e = TestWorkspace.event assert e is not None assert e.current.name == '12'
test: use workspace focus event instead of init
acrisci_i3ipc-python
train
py
c0b06f88119697c309e875e06f0f45b775fbfd08
diff --git a/handler-js.js b/handler-js.js index <HASH>..<HASH> 100644 --- a/handler-js.js +++ b/handler-js.js @@ -79,6 +79,7 @@ function wreq (state, bundler, startFn) { update() bundler.on('update', update) + state.cssStream.on('finish', onCssStreamFinish) return handler @@ -108,6 +109,12 @@ function wreq (state, bundler, startFn) { })) } + function onCssStreamFinish () { + state.cssStream = new stream.PassThrough() + state.cssStream.on('finish', onCssStreamFinish) + state.cssStream.pipe(state.cssBuf) + } + // call the handler function function handler (req, res, next) { if (pending) {
fix: avoid write after end errors This fix aims at avoiding the errors related to b<I>b4fb. The idea behind this is to ensure `state.cssStream` is always writable, even when `extract-css` calls `WriteableStream.prototype.end` on it.
choojs_bankai
train
js
41039afa0c1462762514c61458556e6868beba61
diff --git a/lib/create-contentful-api.js b/lib/create-contentful-api.js index <HASH>..<HASH> 100644 --- a/lib/create-contentful-api.js +++ b/lib/create-contentful-api.js @@ -84,6 +84,11 @@ export default function createContentfulApi ({http, getGlobalOptions}) { if (error.data) { throw error.data } + + if (error.response && error.response.data) { + throw error.response.data + } + throw error }
feat(error): throw appropriate error response (#<I>)
contentful_contentful.js
train
js
2e7391a7c368e6643fbe8080afee96ca05568dfa
diff --git a/lib/gruff/scatter.rb b/lib/gruff/scatter.rb index <HASH>..<HASH> 100644 --- a/lib/gruff/scatter.rb +++ b/lib/gruff/scatter.rb @@ -74,12 +74,11 @@ class Gruff::Scatter < Gruff::Base @x_increment = (@x_spread > 1) ? (@graph_width / (@x_spread - 1).to_f) : @graph_width store.norm_data.each do |data_row| - data_row.y_points.each_with_index do |data_point, index| - x_value = data_row.x_points[index] - next if data_point.nil? || x_value.nil? + data_row.coordinates.each do |x_value, y_value| + next if y_value.nil? || x_value.nil? new_x = get_x_coord(x_value, @graph_width, @graph_left) - new_y = @graph_top + (@graph_height - data_point * @graph_height) + new_y = @graph_top + (@graph_height - y_value * @graph_height) # Reset each time to avoid thin-line errors stroke_width = @stroke_width || clip_value_if_greater_than(@columns / (store.norm_data.first[1].size * 4), 5.0)
refactor: Use coordinates method in order to retrieve X/Y value (#<I>)
topfunky_gruff
train
rb
acc2011f8b820d1bb5cc46609e303dac16dd67ae
diff --git a/lib/plugins/helper/full_url_for.js b/lib/plugins/helper/full_url_for.js index <HASH>..<HASH> 100755 --- a/lib/plugins/helper/full_url_for.js +++ b/lib/plugins/helper/full_url_for.js @@ -3,7 +3,7 @@ const { parse } = require('url'); function urlForHelper(path = '/') { - if (path[0] === '#' || path.startsWith('//')) { + if (path.startsWith('//')) { return path; } diff --git a/test/scripts/helpers/full_url_for.js b/test/scripts/helpers/full_url_for.js index <HASH>..<HASH> 100755 --- a/test/scripts/helpers/full_url_for.js +++ b/test/scripts/helpers/full_url_for.js @@ -29,6 +29,6 @@ describe('full_url_for', () => { }); it('only hash', () => { - fullUrlFor('#test').should.eql('#test'); + fullUrlFor('#test').should.eql(ctx.config.url + '/#test'); }); });
feat(helper): hash url should have config.url prefixed
hexojs_hexo
train
js,js
f1c47d02964d2aabd58f7736f635fbd9b8db8a2d
diff --git a/test/token-program.test.js b/test/token-program.test.js index <HASH>..<HASH> 100644 --- a/test/token-program.test.js +++ b/test/token-program.test.js @@ -489,7 +489,8 @@ test('invalid approve', async () => { }); -test('fail on approve overspend', async () => { +// TODO: Why is this test flaky? +test.skip('fail on approve overspend', async () => { if (mockRpcEnabled) { console.log('non-live test skipped'); return;
test: disable flaky test until it can be debugged
solana-labs_solana-web3.js
train
js
4914797c3333f0fe898c538080bf3c98e0b79fcb
diff --git a/packages/plugin-bibtex/src/mapping/shared.js b/packages/plugin-bibtex/src/mapping/shared.js index <HASH>..<HASH> 100644 --- a/packages/plugin-bibtex/src/mapping/shared.js +++ b/packages/plugin-bibtex/src/mapping/shared.js @@ -152,7 +152,7 @@ export function parseMonth (value) { return [] } - if (parseInt(value, 10)) { + if (+value) { return [parseInt(value, 10)] }
fix(plugin-bibtex): do not ignore month after day Do not ignore month names after days in month fields.
citation-js_citation-js
train
js
f3662ea116c2227753595044420ba605b504e024
diff --git a/lib/plugins/index.js b/lib/plugins/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/index.js +++ b/lib/plugins/index.js @@ -1543,7 +1543,7 @@ pluginMgr.setProxy = function (p) { httpMgr.setPluginMgr(pluginMgr); var PLUGIN_KEY_RE =/^\$(?:whistle\.)?([a-z\d_-]+)[/:]([^\s]+)$/; -var MAX_VALUE_LEN = 1024 * 1024 * 32; +var MAX_VALUE_LEN = 1024 * 1024 * 12; function requestValue(options, callback, isBin) { options.needRawData = isBin;
refactor: refine max value size
avwo_whistle
train
js
be1459a6621c348cf478df9b03f4a13fa7f90620
diff --git a/src/aurelia-form.js b/src/aurelia-form.js index <HASH>..<HASH> 100644 --- a/src/aurelia-form.js +++ b/src/aurelia-form.js @@ -3,6 +3,9 @@ import {getLogger} from 'aurelia-logging'; export const logger = getLogger('aurelia-form'); +export {placeholder} from './decorator/placeholder'; +export {label} from './decorator/label'; + export function configure(aurelia, config) { aurelia.aurelia.use.plugin('aurelia-view-manager'); @@ -50,6 +53,7 @@ export const config = { integer: 'input', number : 'input', float : 'input', + string : 'input', bool : 'checkbox', boolean: 'checkbox', text : 'input'
chore(project): export decorators
SpoonX_aurelia-form
train
js
6a10be34a41ef72f45152e764a292c9533d46bae
diff --git a/.circleci/upload-preview.js b/.circleci/upload-preview.js index <HASH>..<HASH> 100644 --- a/.circleci/upload-preview.js +++ b/.circleci/upload-preview.js @@ -18,7 +18,7 @@ if (!uploadFolder) { const uploadFolderName = path.basename(uploadFolder); let uploadURL = `${repo}-${prnum ? `pr-${prnum}` : prbranch}` .replace(/[\/|\.]/g, '-') - .replace('-master', ''); + .replace('-main', ''); if (uploadFolderName === '.out') { uploadURL += '-pf3';
fix(upload): use patternfly-react.surge.sh
patternfly_patternfly-react
train
js
a0d917de3d9573bae067af254ed09457a77a1190
diff --git a/module.js b/module.js index <HASH>..<HASH> 100644 --- a/module.js +++ b/module.js @@ -1,3 +1,28 @@ module.exports = ( require( 'classes' ).Module ).extend({ + preRoute: function() { + var injector = require( 'injector' ) + , UserModel = injector.getInstance( 'UserModel' ) + , RoleModel = injector.getInstance( 'RoleModel' ) + , PermissionModel = injector.getInstance( 'PermissionModel' ); + UserModel.on( 'preQuery', function( options ) { + console.log( 'UserModel:preQuery()'); + if ( typeof options.include === 'undefined' ) { + options.include = []; + } + if ( options.include.indexOf( RoleModel._model ) === -1 ) { + options.include.push( RoleModel._model ); + } + }); + + RoleModel.on( 'preQuery', function( options ) { + console.log( 'RoleModel:preQuery()'); + if ( typeof options.include === 'undefined' ) { + options.include = []; + } + if ( options.include.indexOf( PermissionModel._model ) === -1 ) { + options.include.push( PermissionModel._model ); + } + }); + } }); \ No newline at end of file
feat(events): Implemented preQuery event for Roles
CleverStack_clever-roles
train
js
eaf862f28ff3ad42643ecc2038762a479b202e40
diff --git a/intranet/settings/__init__.py b/intranet/settings/__init__.py index <HASH>..<HASH> 100644 --- a/intranet/settings/__init__.py +++ b/intranet/settings/__init__.py @@ -42,6 +42,7 @@ ENABLE_WAITLIST = True ENABLE_BUS_APP = True ENABLE_BUS_DRIVER = True ENABLE_PRE_EIGHTH_REDIRECT = False +NOTIFY_ADMIN_EMAILS = None EMERGENCY_MESSAGE = None # type: str
chore(settings): reconcile settings
tjcsl_ion
train
py
4d44752847d748f7c56af57e1de436700219cc3c
diff --git a/lib/config/definitions.js b/lib/config/definitions.js index <HASH>..<HASH> 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -423,6 +423,7 @@ const options = [ description: 'Whether to add digests to Dockerfile source images', stage: 'package', type: 'boolean', + default: false, }, { name: 'separateMajorMinor', diff --git a/test/manager/docker/package.spec.js b/test/manager/docker/package.spec.js index <HASH>..<HASH> 100644 --- a/test/manager/docker/package.spec.js +++ b/test/manager/docker/package.spec.js @@ -32,6 +32,7 @@ describe('lib/manager/docker/package', () => { currentDepTag: 'some-dep:1.0.0', currentTag: '1.0.0', currentDigest: 'sha256:abcdefghijklmnop', + pinDigests: true, }; }); it('returns empty if no digest', async () => {
feat: disable pinDigests by default
renovatebot_renovate
train
js,js
7f3d1e53d1d6b3ef5501c5ee817859a99dc69008
diff --git a/intranet/apps/eighth/models.py b/intranet/apps/eighth/models.py index <HASH>..<HASH> 100644 --- a/intranet/apps/eighth/models.py +++ b/intranet/apps/eighth/models.py @@ -1410,7 +1410,7 @@ class EighthScheduledActivity(AbstractBaseEighthModel): after_deadline=after_deadline, previous_activity_name=previous_activity_name, previous_activity_sponsors=previous_activity_sponsors, - own_signup=(user == request.user), + own_signup=(request is not None and user == request.user), ) if signup.has_conflict(): @@ -1471,7 +1471,7 @@ class EighthScheduledActivity(AbstractBaseEighthModel): after_deadline=after_deadline, previous_activity_name=previous_activity_name, previous_activity_sponsors=previous_activity_sponsors, - own_signup=(user == request.user), + own_signup=(request is not None and user == request.user), ) if signup.has_conflict():
fix(eighth): don't count on request being passed in add_user()
tjcsl_ion
train
py
f405f0ec6f0766bf66bc77d1450579c61f587979
diff --git a/packages/amazon-cognito-identity-js/src/CognitoUserPool.js b/packages/amazon-cognito-identity-js/src/CognitoUserPool.js index <HASH>..<HASH> 100644 --- a/packages/amazon-cognito-identity-js/src/CognitoUserPool.js +++ b/packages/amazon-cognito-identity-js/src/CognitoUserPool.js @@ -19,6 +19,8 @@ import Client from './Client'; import CognitoUser from './CognitoUser'; import StorageHelper from './StorageHelper'; +const USER_POOL_ID_MAX_LENGTH = 55; + /** @class */ export default class CognitoUserPool { /** @@ -46,7 +48,7 @@ export default class CognitoUserPool { if (!UserPoolId || !ClientId) { throw new Error('Both UserPoolId and ClientId are required.'); } - if (!/^[\w-]+_.+$/.test(UserPoolId)) { + if (UserPoolId.length > USER_POOL_ID_MAX_LENGTH || !/^[\w-]+_[0-9a-zA-Z]+$/.test(UserPoolId)) { throw new Error('Invalid UserPoolId format.'); } const region = UserPoolId.split('_')[0];
fix(amazon-cognito-identity-js): Fix UserPoolId validation ReDoS (#<I>)
aws-amplify_amplify-js
train
js
bc853ad309054d1d16be4056be033a7d39a33ed7
diff --git a/lib/util/package-rules.js b/lib/util/package-rules.js index <HASH>..<HASH> 100644 --- a/lib/util/package-rules.js +++ b/lib/util/package-rules.js @@ -164,7 +164,7 @@ function applyPackageRules(inputConfig) { currentValue && isVersion(currentValue) ? currentValue // it's a version so we can match against it : lockedVersion || fromVersion; // need to match against this fromVersion, if available - if (compareVersion) { + if (compareVersion && isVersion(compareVersion)) { const isMatch = matches(compareVersion, matchCurrentVersion); positiveMatch = positiveMatch || isMatch; negativeMatch = negativeMatch || !isMatch;
fix(package-rules): check compareVersion is a version first Closes #<I>
renovatebot_renovate
train
js
91ed54a5ed020d83d385f3e74d23553a9c12cc19
diff --git a/blueprints/ember-uikit/index.js b/blueprints/ember-uikit/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-uikit/index.js +++ b/blueprints/ember-uikit/index.js @@ -9,7 +9,7 @@ module.exports = { afterInstall() { const stylePath = path.join("app", "styles"); const file = path.join(stylePath, "app.scss"); - const importStatement = "@import 'ember-uikit';"; + const importStatement = '@import "ember-uikit";'; if (!fs.existsSync(stylePath)) { fs.mkdirSync(stylePath); @@ -21,7 +21,7 @@ module.exports = { fs.writeFileSync(file, importStatement); } - this._writeStatusToUI("add import statement", file); + this.ui.writeLine("add import statement", file); return this.addAddonToProject("ember-cli-sass"); },
fix(blueprint): fix blueprint
adfinis-sygroup_ember-uikit
train
js
5cbceed208f61f4b613ccd5b00fbf82f75a0ef91
diff --git a/job/payload.go b/job/payload.go index <HASH>..<HASH> 100644 --- a/job/payload.go +++ b/job/payload.go @@ -23,7 +23,7 @@ const ( ) func SupportedUnitTypes() []string { - return []string{"service", "socket"} + return []string{"service", "socket", "timer"} } type JobPayload struct { @@ -48,8 +48,8 @@ func (jp *JobPayload) Type() (string, error) { // Peers returns a list of Payload names that must be scheduled to the same // machine as this Payload. If no peers were explicitly defined for certain unit // types, a default list of peers will be returned. This behavior only applies -// to the socket unit type. For example, the default peer of foo.socket would -// be foo.service. +// to the socket and timer unit types. For example, the default peer of foo.socket +// or foo.timer would be foo.service. func (jp *JobPayload) Peers() []string { if peers, ok := jp.Requirements()[FleetXConditionMachineOf]; ok { return peers @@ -62,7 +62,7 @@ func (jp *JobPayload) Peers() []string { return peers } - if jpType != "socket" { + if jpType != "socket" && jpType != "timer" { return peers }
feat(payload): support timer units * Allow users to submit systemd timer units * Add a default peer to systemd timer units similar to the handling of socket units
coreos_fleet
train
go
0881e0621362bca60c5dc4fe2477b93257b452e9
diff --git a/manager/api/core/src/main/java/io/apiman/manager/api/core/config/ApiManagerConfig.java b/manager/api/core/src/main/java/io/apiman/manager/api/core/config/ApiManagerConfig.java index <HASH>..<HASH> 100644 --- a/manager/api/core/src/main/java/io/apiman/manager/api/core/config/ApiManagerConfig.java +++ b/manager/api/core/src/main/java/io/apiman/manager/api/core/config/ApiManagerConfig.java @@ -85,7 +85,7 @@ public abstract class ApiManagerConfig { /* ------------------------------------------------------- * Endpoint-related * ------------------------------------------------------- */ - public static final String APIMAN_MANAGER_UI_ENDPOINT = "apiman-manager-ui.api.endpoint"; + public static final String APIMAN_MANAGER_UI_ENDPOINT = "apiman-manager.ui.endpoint"; private final Configuration config;
fix(manager-api): use correct system property for UI endpoint
apiman_apiman
train
java
285bb46d52c5038d7c9e9e9095489334670b872b
diff --git a/src/decorators.js b/src/decorators.js index <HASH>..<HASH> 100644 --- a/src/decorators.js +++ b/src/decorators.js @@ -12,14 +12,14 @@ export function autoinject(potentialTarget?: any) { } export function inject(...rest: any[]) { - return function(target,key, descriptor) { + return function(target, key, descriptor) { // if it's true then we injecting rest into function and not Class constructor - if(descriptor) { - const fn = descriptor.value; - fn.inject = rest; - } else { - target.inject = rest; - } + if (descriptor) { + const fn = descriptor.value; + fn.inject = rest; + } else { + target.inject = rest; + } }; }
chore(decorators): fix lint errors
aurelia_dependency-injection
train
js
ba23eb752463744b90d2f12c826d7dcefedb1347
diff --git a/src/ValidationError.js b/src/ValidationError.js index <HASH>..<HASH> 100644 --- a/src/ValidationError.js +++ b/src/ValidationError.js @@ -34,7 +34,8 @@ ValidationError.isError = function (err) { }; ValidationError.formatError = function (message, params) { - params.path = params.label || params.path || 'this'; + const path = params.label || params.path || 'this'; + if (path !== params.path) params = { ...params, path }; if (typeof message === 'string') return message.replace(strReg, (_, key) => printValue(params[key]));
fix: path params incorrectly mutated fixes #<I>
jquense_yup
train
js
f2f747e25efc78967ff45567b52d9da8622f141e
diff --git a/tests/api/_open.py b/tests/api/_open.py index <HASH>..<HASH> 100644 --- a/tests/api/_open.py +++ b/tests/api/_open.py @@ -3,7 +3,6 @@ # License: MIT # # pylint: disable=missing-docstring, invalid-name, no-member -import io import pathlib import pickle import tempfile @@ -20,24 +19,16 @@ class TestCase(unittest.TestCase): def test_open_text_io(self): path = respath('common/10.json') with TT.open(path) as fio: - self.assertTrue( - isinstance(fio, io.TextIOBase), - f'{fio!r}' - ) self.assertEqual(fio.mode, 'r') def test_open_byte_io(self): cnf = dict(a=1, b='b') with tempfile.TemporaryDirectory() as workdir: - path = pathlib.Path(workdir) + path = pathlib.Path(workdir) / 'test.pkl' pickle.dump(cnf, path.open(mode='wb')) with TT.open(path) as fio: - self.assertTrue( - isinstance(fio, io.TextIOBase), - f'{path}' - ) self.assertEqual(fio.mode, 'rb') # vim:sw=4:ts=4:et:
fix: remove unstable checks and ensure pickle data dumped to a file
ssato_python-anyconfig
train
py
1696c10618d374b1c4419ce419ab99a12439e63e
diff --git a/env_test.go b/env_test.go index <HASH>..<HASH> 100644 --- a/env_test.go +++ b/env_test.go @@ -330,18 +330,11 @@ func TypeCustomParserBasicInvalid(t *testing.T) { Const ConstT `env:"CONST_VAL"` } - envVal := "invalid" + os.Setenv("CONST_VAL", "foobar") - _, expErr := strconv.Atoi(envVal) - os.Setenv("CONST_VAL", envVal) - - customParserFunc := func(v string) (interface{}, error) { - i, err := strconv.Atoi(v) - if err != nil { - return nil, err - } - r := ConstT(i) - return r, nil + expErr := errors.New("Random error") + customParserFunc := func(_ string) (interface{}, error) { + return nil, expErr } cfg := &config{} @@ -351,7 +344,7 @@ func TypeCustomParserBasicInvalid(t *testing.T) { assert.Empty(t, cfg.Const) assert.Error(t, err) - assert.Equal(t, expErr.Error(), err.Error()) + assert.Equal(t, expErr, err) } func TestCustomParserBasicUnsupported(t *testing.T) {
fix: Cover case where custom parser returns error - Custom parser returning error wasn't covered
caarlos0_env
train
go
bfecb8c57ccaff0d852a5a4d77af04cbedaeec83
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -110,7 +110,16 @@ function buildEnvCommandLineParams(config, envData, $logger) { envFlagNames.splice(snapshotEnvIndex, 1); } - return envFlagNames.map(item => `--env.${item}=${envData[item]}`); + const args = []; + envFlagNames.map(item => { + let envValue = envData[item]; + if(!Array.isArray(envValue)) { + envValue = [envValue]; + } + envValue.map(value => args.push(`--env.${item}=${value}`)) + }); + + return args; } function logSnapshotWarningMessage($logger) {
fix: array env args are serialized when sent to webpack (#<I>)
NativeScript_nativescript-dev-webpack
train
js
cb52c202f13bd693351b800815ede6245963ba13
diff --git a/drivers/store/memory/cache_test.go b/drivers/store/memory/cache_test.go index <HASH>..<HASH> 100644 --- a/drivers/store/memory/cache_test.go +++ b/drivers/store/memory/cache_test.go @@ -59,13 +59,13 @@ func TestCacheIncrementConcurrent(t *testing.T) { for i := 0; i < goroutines; i++ { go func(i int) { if (i % 3) == 0 { - time.Sleep(600 * time.Millisecond) + time.Sleep(2 * time.Second) for j := 0; j < ops; j++ { - cache.Increment(key, int64(i+j), (200 * time.Millisecond)) + cache.Increment(key, int64(i+j), (1 * time.Second)) } } else { time.Sleep(50 * time.Millisecond) - stopAt := time.Now().Add(400 * time.Millisecond) + stopAt := time.Now().Add(500 * time.Millisecond) for time.Now().Before(stopAt) { cache.Increment(key, int64(i), (75 * time.Millisecond)) }
refactor: travis is slow, increase timers
ulule_limiter
train
go
e7b73f0dd4b20a7ea7d7244d4f9b85db515af45c
diff --git a/src/cli.js b/src/cli.js index <HASH>..<HASH> 100644 --- a/src/cli.js +++ b/src/cli.js @@ -36,7 +36,7 @@ const semver = require('semver'); const NODE_VERSION = process.version; // When there is no node version in the deprecation stage, set to null or false. -const NODE_VERSION_REQUIREMENT = '>=8'; +const NODE_VERSION_REQUIREMENT = false; const NODE_VERSION_DEPRECATING_RANGE = '<10'; var knownOpts = { @@ -302,10 +302,15 @@ function cli (inputArgs) { let warningPartial = null; // If the Node.js versions does not meet our requirements or in a deprecation stage, display a warning. - if (!semver.satisfies(NODE_VERSION, NODE_VERSION_REQUIREMENT)) { + if ( + NODE_VERSION_REQUIREMENT && + !semver.satisfies(NODE_VERSION, NODE_VERSION_REQUIREMENT) + ) { warningPartial = 'is no longer supported'; - } else if (NODE_VERSION_DEPRECATING_RANGE && - semver.satisfies(NODE_VERSION, NODE_VERSION_DEPRECATING_RANGE)) { + } else if ( + NODE_VERSION_DEPRECATING_RANGE && + semver.satisfies(NODE_VERSION, NODE_VERSION_DEPRECATING_RANGE) + ) { warningPartial = 'has been deprecated'; }
chore: drop node-8 deprecation transition step (#<I>)
apache_cordova-cli
train
js
aaafa06db296632dfac699f9fd4b9668727a8a09
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -75,7 +75,7 @@ gulp.task('bump', function () { .pipe(gulp.dest('./')); }) -gulp.task("release", ['bump', 'concat', 'minify'], function () { +gulp.task("release", ['concat', 'minify'], function () { // see eg // https://github.com/tomchentw/gulp-livescript/blob/master/gulpfile.ls // Note: http://stackoverflow.com/questions/9210542
fix(build): separate 'bump' from 'release' tasks
knockout_tko.provider
train
js
9ba4e118487d777c48c908aad209ec24f04da314
diff --git a/test/get-firefox-bin.js b/test/get-firefox-bin.js index <HASH>..<HASH> 100644 --- a/test/get-firefox-bin.js +++ b/test/get-firefox-bin.js @@ -19,7 +19,7 @@ const testGetFirefox = async (t, platform) => { shell: true, cwd: temporaryDirectory.path }); - t.is(stderr, ''); + t.regex(stderr, /^\(node:\d+\) ExperimentalWarning: stream\/web is an experimental feature\. This feature could change at any time\n\(Use `node --trace-warnings \.\.\.` to show where the warning was created\)\n$/); const files = await fs.readdir(temporaryDirectory.path); t.is(files.length, 1, "One file was downloaded"); const filePath = path.join(temporaryDirectory.path, files[0]);
test: lts still has the warning
freaktechnik_get-firefox
train
js
e7ac5e7f523548286a412dd2588bc17d4e8e11eb
diff --git a/test/writetime.js b/test/writetime.js index <HASH>..<HASH> 100644 --- a/test/writetime.js +++ b/test/writetime.js @@ -5,6 +5,9 @@ var _ = require('underscore'); var util = require('util'); var test_utils = require('./test-utils'); +var types = TestClient.types; +var encodings = TestClient.encodings; + var ks = 'bigint_test'; var table = 'biginttest'; @@ -40,7 +43,7 @@ describe('bigint support', function() { .then(function() { // Get the writetime value for a column var cql = util.format('SELECT writetime(col1) AS wt FROM %s WHERE key = ?', table); - return client.execute(cql, ['row-1']); + return client.execute(cql, ['row-1'], {result_types: [types.CASS_VALUE_TYPE_TIMESTAMP | encodings.BIGINT_AS_OBJECT]}); }) .then(function(results) { expect(results.rows.length).equal(1);
test: update writetime test to the new encoding API
demmer_node-cassandra-native-driver
train
js
492bf54bf14e4c21907fcce5dd0e79b07541f096
diff --git a/helpers/hasValue.js b/helpers/hasValue.js index <HASH>..<HASH> 100644 --- a/helpers/hasValue.js +++ b/helpers/hasValue.js @@ -1,10 +1,19 @@ var rules = require('./rules.js') +function parseKey(value) { + if (typeof value === 'string') { + var args = value.split(/:(.+)?/) + return args[1] ? {key: args[0], params: JSON.parse(args[1])} : {key: value} + } + return {key:value} +} + module.exports = function (form, value, isValueRules) { return isValueRules.reduce(function (isValue, key) { if (!isValue) { return false } - return rules[key](value, form) + var parsedKey = parseKey(key) + return rules[parsedKey.key](value, form, parsedKey.params) }, true) }
fix: rules[key] is not a function if you pass isValue with parameters fix: #<I>
cerebral-legacy_cerebral-module-forms
train
js
ee81f1f2be91411c2dd8f9324c19405aa582b7c9
diff --git a/src/convert.js b/src/convert.js index <HASH>..<HASH> 100644 --- a/src/convert.js +++ b/src/convert.js @@ -167,11 +167,11 @@ export default function convert(jcamp, options = {}) { currentEntry.title = dataValue; } else if (canonicDataLabel === 'DATATYPE') { currentEntry.dataType = dataValue; - if (dataValue.toLowerCase().indexOf('nd') > -1) { + if (dataValue.match(/(^nd|\snd\s)/i)) { currentEntry.twoD = true; } } else if (canonicDataLabel === 'NTUPLES') { - if (dataValue.toLowerCase().indexOf('nd') > -1) { + if (dataValue.match(/(^nd|\snd\s)/i)) { currentEntry.twoD = true; } } else if (canonicDataLabel === 'DATACLASS') {
fix: more selective to generate 2D
cheminfo-js_jcampconverter
train
js
e73f240e0b30961a6160a14747220e721d76aedf
diff --git a/packages/mongoose-helper/src/index.js b/packages/mongoose-helper/src/index.js index <HASH>..<HASH> 100644 --- a/packages/mongoose-helper/src/index.js +++ b/packages/mongoose-helper/src/index.js @@ -59,7 +59,7 @@ class Base { * @returns {Promise<ListResult>} */ static list({ - filter, + filter = {}, lean = false, limit = 100, offset = 0,
fix: mongoose-helper filter null
36node_sketch
train
js
0963d93284f1f4277b2615f3013181673a879a7e
diff --git a/build/gulp.docs.js b/build/gulp.docs.js index <HASH>..<HASH> 100644 --- a/build/gulp.docs.js +++ b/build/gulp.docs.js @@ -48,7 +48,8 @@ const alterReference = async () => { } }) - fs.writeFileSync(path.join(__dirname, '../docs/reference/public/index.html'), $.html()) + const fixedContentPaths = $.html().replace('../assets/', 'assets/') + fs.writeFileSync(path.join(__dirname, '../docs/reference/public/index.html'), fixedContentPaths) } const buildReference = () => {
fix(docs): corrected path to assets
botpress_botpress
train
js
a73c157dfffc2ce45f99881875b0a464adf2939d
diff --git a/render/vnode.js b/render/vnode.js index <HASH>..<HASH> 100644 --- a/render/vnode.js +++ b/render/vnode.js @@ -8,7 +8,7 @@ Vnode.normalize = function(node) { if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node === false ? "" : node, undefined, undefined) return node } -Vnode.normalizeChildren = function normalizeChildren(input) { +Vnode.normalizeChildren = function(input) { var children = [] for (var i = 0; i < input.length; i++) { children[i] = Vnode.normalize(input[i])
refactor: Vnode.normalizeChildren to anonymous function (#<I>)
MithrilJS_mithril.js
train
js
9120d1d81e2c928188016dee224d08530d17227c
diff --git a/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber.rb b/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber.rb index <HASH>..<HASH> 100644 --- a/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber.rb +++ b/google-cloud-pubsub/lib/google/cloud/pubsub/subscriber.rb @@ -123,10 +123,12 @@ module Google end ## - # Begins the process of stopping the subscriber. Unhandled received - # messages will be processed, but no new messages will be pulled from - # the subscription. Use {#wait!} to block until the subscriber is fully - # stopped and all received messages have been processed. + # Immediately stops the subscriber. No new messages will be pulled from + # the subscription. All actions taken on received messages that have not + # yet been sent to the API will be sent to the API. All received but + # unprocessed messages will be released back to the API and redelivered. + # Use {#wait!} to block until the subscriber is fully stopped and all + # received messages have been processed or released. # # @return [Subscriber] returns self so calls can be chained. def stop @@ -147,9 +149,11 @@ module Google ## # Blocks until the subscriber is fully stopped and all received messages - # have been handled. Does not stop the subscriber. To stop the - # subscriber, first call {#stop} and then call {#wait!} to block until - # the subscriber is stopped. + # have been processed or released. + # + # Does not stop the subscriber. To stop the subscriber, first call + # {#stop} and then call {#wait!} to block until the subscriber is + # stopped. # # @return [Subscriber] returns self so calls can be chained. def wait!
docs(pubsub): Update Subscriber stop and wait documentation * Update Subscriber#stop and Subscriber#wait! method descriptions to reflect the behavior as of release <I>. pr: #<I>
googleapis_google-cloud-ruby
train
rb
8e831b43658028dba5ebe2c0bc2f359aa11ff235
diff --git a/lib/util/index.js b/lib/util/index.js index <HASH>..<HASH> 100644 --- a/lib/util/index.js +++ b/lib/util/index.js @@ -517,7 +517,7 @@ exports.disableCSP = disableCSP; var interfaces = os.networkInterfaces(); var hostname = os.hostname(); var addressList = []; -var hashData = ['x-whistle-client-id', Date.now(), Math.random(), Math.random()]; +var interfaceData = []; (function updateSystyemInfo () { interfaces = os.networkInterfaces(); @@ -536,11 +536,11 @@ var hashData = ['x-whistle-client-id', Date.now(), Math.random(), Math.random()] Object.keys(interfaces).forEach(function(ifname) { interfaces[ifname].forEach(function (iface) { - hashData.push(iface.address); + interfaceData.push(iface.address); }); }); -var clientId = crypto.createHmac('sha256', '' + Date.now()).update(hashData.join()).digest('hex') +var clientId = crypto.createHmac('sha256', 'x-whistle-client-id').update(interfaceData.join()).digest('hex') + Math.floor(Math.random() * 1000000).toString(16); exports.setClientId = function(headers, enable) { if (enable && (enable.clientId || enable.clientID || enable.clientid)) {
refactor: generate client id by os.networkInterfaces()
avwo_whistle
train
js
acf7ee0f002bc224d52241df144cdb6ffb0a16b1
diff --git a/src/form.js b/src/form.js index <HASH>..<HASH> 100644 --- a/src/form.js +++ b/src/form.js @@ -16,6 +16,8 @@ export class Form { messages = {} + isValid + /*** * Used to get access to onSubmit and model changes could also wrap the * change and submit methods instead @@ -31,7 +33,8 @@ export class Form { this.validator = new Validator(model); this.reporter = ValidationEngine.getValidationReporter(model); this.observer = this.reporter.subscribe(validationErrors => { - this.messages = validationErrors.reduce( (errors, error) => { + this.isValid = Object.keys(validationErrors).length === 0; + this.messages = validationErrors.reduce((errors, error) => { errors[error.propertyName] = error.message; return errors; }, {}); @@ -48,13 +51,13 @@ export class Form { } submit() { - this.onSubmit(this.model); this.validate(); + this.onSubmit(this.model); } change() { - this.onChange(this.model); this.validate(); + this.onChange(this.model); } }
feat(form): isValid property on Form
SpoonX_aurelia-form
train
js
763687e0509cf03ed77a19f4f33adebbd9d83f89
diff --git a/packages/vaex-core/vaex/dataframe.py b/packages/vaex-core/vaex/dataframe.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/dataframe.py +++ b/packages/vaex-core/vaex/dataframe.py @@ -311,7 +311,6 @@ class DataFrame(object): def execute(self): '''Execute all delayed jobs.''' - # no need to clear _task_aggs anymore, since they will be removed for the executors' task list from .asyncio import just_run just_run(self.execute_async()) diff --git a/packages/vaex-core/vaex/execution.py b/packages/vaex-core/vaex/execution.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/execution.py +++ b/packages/vaex-core/vaex/execution.py @@ -66,6 +66,10 @@ class Executor: logger.info("executing tasks in run: %r", tasks) for task in tasks: self.tasks.remove(task) + # make sure we remove it from task_aggs, otherwise we can memleak + for key, value in list(task.df._task_aggs.items()): + if value is task: + del task.df._task_aggs[key] return tasks
fix: memleak because of references to old tasks
vaexio_vaex
train
py,py
8a7bc9e8a5f234bc3bcdedd653cbc91e448e01b9
diff --git a/src/components/OverflowMenu/OverflowMenu.js b/src/components/OverflowMenu/OverflowMenu.js index <HASH>..<HASH> 100644 --- a/src/components/OverflowMenu/OverflowMenu.js +++ b/src/components/OverflowMenu/OverflowMenu.js @@ -655,7 +655,7 @@ export default class OverflowMenu extends Component { /> ); } - return <OverflowMenuVertical16 />; + return <OverflowMenuVertical16 {...iconProps} />; })(); return (
fix(overflowMenu): include iconProps for CarbonX version (#<I>)
carbon-design-system_carbon-components-react
train
js
7f63aa69a7bfca3f6de34ff34963d3ebffed4b17
diff --git a/packages/style-utils/src/styleVariables.js b/packages/style-utils/src/styleVariables.js index <HASH>..<HASH> 100644 --- a/packages/style-utils/src/styleVariables.js +++ b/packages/style-utils/src/styleVariables.js @@ -220,6 +220,11 @@ export default { fontSize_prose: '1rem', fontSize_ui: '0.875rem', + fontWeight_regular: 400, + fontWeight_semiBold: 600, + fontWeight_bold: 700, + fontWeight_extraBold: 800, + lineHeight: 1.25, lineHeight_prose: 1.5,
feat(theme): Add fontWeight variables
mineral-ui_mineral-ui
train
js
7407cacb22905ec6dddff0e581e35129b5a00ce8
diff --git a/src/components/Profile/Profile.react.js b/src/components/Profile/Profile.react.js index <HASH>..<HASH> 100644 --- a/src/components/Profile/Profile.react.js +++ b/src/components/Profile/Profile.react.js @@ -14,6 +14,7 @@ export type Props = {| +avatarURL?: string, +twitterURL?: string, +backgroundURL?: string, + +bio?: string, |}; function Profile({ @@ -23,6 +24,7 @@ function Profile({ avatarURL = "", twitterURL = "", backgroundURL = "", + bio, }: Props): React.Node { const classes = cn("card card-profile", className); return ( @@ -31,7 +33,7 @@ function Profile({ <Card.Body className="text-center"> <ProfileImage avatarURL={avatarURL} /> <Header.H3 className="mb-3">{name}</Header.H3> - <p className="mb-4">{children}</p> + <p className="mb-4">{bio || children}</p> <Button outline color="primary" size="sm"> <Icon name="twitter" prefix="fa" /> Follow </Button>
feat(Profile): add bio prop, used instead of/before children
tabler_tabler-react
train
js
aa206da8d2b2e56ac8b44552d12399be71112e2e
diff --git a/timeside/analyzer/irit_monopoly.py b/timeside/analyzer/irit_monopoly.py index <HASH>..<HASH> 100644 --- a/timeside/analyzer/irit_monopoly.py +++ b/timeside/analyzer/irit_monopoly.py @@ -20,11 +20,12 @@ # Author: Maxime Le Coz <lecoz@irit.fr> from __future__ import absolute_import from timeside.analyzer.utils import segmentFromValues -from timeside.core import implements, interfacedoc, get_processor +from timeside.core import implements, interfacedoc from timeside.analyzer.core import Analyzer from timeside.api import IAnalyzer import numpy from timeside.analyzer.preprocessors import frames_adapter +from timeside.analyzer.aubio.aubio_pitch import AubioPitch class IRITMonopoly(Analyzer): @@ -39,7 +40,7 @@ class IRITMonopoly(Analyzer): def __init__(self): super(IRITMonopoly, self).__init__() - self.parents.append(get_processor('aubio_pitch')()) + self.parents.append(AubioPitch()) # Irit Monopoly parameters self.decisionLen = 1.0
fix(irit_monoply): explicit import of AubioPitch in preamble This prevent from import error in system where aubio is not installed. Thus Irit_monopoly will not be available. either.
Parisson_TimeSide
train
py
52e265f328ddd50ace04da7cedb615d3a8f67d1f
diff --git a/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAEditRestriction.java b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAEditRestriction.java index <HASH>..<HASH> 100755 --- a/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAEditRestriction.java +++ b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAEditRestriction.java @@ -46,6 +46,7 @@ public class LPAEditRestriction implements ILayoutProcessingAction { * Pushes the indicated restriction attribute changes into both the ILF and PLF versions of the * layouts since this will only be done when editing a fragment. */ + @Override public void perform() throws PortalException { Element plfNode = HandlerUtils.getPLFNode(ilfNode, person, false, false);
docs: annotate LPAEditRestriction perform() as @Override
Jasig_uPortal
train
java
84133e063b4de02b4690478fcf2c83d8421dd61a
diff --git a/src/collections/Router.js b/src/collections/Router.js index <HASH>..<HASH> 100644 --- a/src/collections/Router.js +++ b/src/collections/Router.js @@ -65,6 +65,11 @@ const methods = { ret.id = `${ret.type}-root`; } + // 有些特殊情况 id 会重复(同样的父子路由,出现在多处,可能父亲的父亲不一样) + if (routeByIds[ret.id]) { + ret.id = `${ret.id}_${Math.random()}`; + } + if (node.children) { ret.children = node.children .filter(node => node.type === 'JSXElement')
fix: avoid route id repeat
dvajs_dva-ast
train
js
668564142bd3635bedf3c27d4d2b64b29a81715e
diff --git a/functional/server_tests.js b/functional/server_tests.js index <HASH>..<HASH> 100644 --- a/functional/server_tests.js +++ b/functional/server_tests.js @@ -1044,7 +1044,7 @@ describe('Server tests', function() { let err; try { expect(error).to.be.an.instanceOf(Error); - expect(error.message).to.match(/but this version of the Node.js Driver requires/) + expect(error.message).to.match(/but this version of the Node.js Driver requires/); } catch (e) { err = e; }
chore: clean up linting issues introduced by SDAM backport
mongodb_node-mongodb-native
train
js
a7792f6aba929bfbfc799c2b246d8580723c0daa
diff --git a/get-poetry.py b/get-poetry.py index <HASH>..<HASH> 100644 --- a/get-poetry.py +++ b/get-poetry.py @@ -227,7 +227,7 @@ It will add the `poetry` command to {poetry}'s bin directory, located at: {platform_msg} -You can uninstall at any time with `poetry self:uninstall`, +You can uninstall at any time with `poetry self uninstall`, or by executing this script with the --uninstall option, and these changes will be reverted. """
fix: change `self:uninstall` to `self uninstall` in `get-poetry.py` (#<I>)
sdispater_poetry
train
py
3d3299ee1322de200ef1382f64417a32b7d10aca
diff --git a/jobs/registry-change.js b/jobs/registry-change.js index <HASH>..<HASH> 100644 --- a/jobs/registry-change.js +++ b/jobs/registry-change.js @@ -52,7 +52,7 @@ module.exports = async function ( }) if (!distTag) { - log.info('exited: dependency has no distTag') + log.info(`exited: ${dependency} has no distTag`) return } await npm.put(updatedAt(Object.assign(npmDbDoc, npmDoc))) @@ -61,7 +61,7 @@ module.exports = async function ( // so we can heavily optimise by exiting here // we want to handle different distTags in the future if (distTag !== 'latest') { - log.info('exited: dependency distTag is not latest') + log.info(`exited: ${dependency} distTag is ${distTag} (not latest)`) return } @@ -99,7 +99,7 @@ module.exports = async function ( log.info(`exited: no repoDocs found that depend on ${dependency}`) return } - log.info(`found ${packageFilesForUpdatedDependency.length} repoDocs that have that dependency`) + log.info(`found ${packageFilesForUpdatedDependency.length} repoDocs that use ${dependency}`) if (packageFilesForUpdatedDependency.length > 100) statsd.event('popular_package')
fix(registry-change): more context in logs
greenkeeperio_greenkeeper
train
js
4999d372460c03de85cd6865583fb0fb7f25a365
diff --git a/lib/rules/index.js b/lib/rules/index.js index <HASH>..<HASH> 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -84,7 +84,7 @@ function getProxy(url, req, callback) { if (host.port) { matcher = matcher + ':' + host.port; } - req._phost = parseUrl(util.setProtocol(matcher)).host; + req._phost = matcher; req.headers[HOST_HEADER] = util.encodeURIComponent(host.rawPattern + ' ' + matcher); } else { reqRules.host = host; @@ -101,6 +101,9 @@ function getProxy(url, req, callback) { if (!req._phost && P_HOST_RE.test(proxy.matcher)) { req._phost = RegExp.$1; } + if (req._phost) { + req._phost = parseUrl(util.setProtocol(req._phost)); + } reqRules.proxy = proxy; return callback(); }
feat: supports to set hosts for proxy
avwo_whistle
train
js
91d7717bca208307d63bba8a3ef1174a6f839e74
diff --git a/packages/with-without/js/with-without.js b/packages/with-without/js/with-without.js index <HASH>..<HASH> 100644 --- a/packages/with-without/js/with-without.js +++ b/packages/with-without/js/with-without.js @@ -89,3 +89,9 @@ if (learnMoreModal) { } }); } + +// Force just the size-setting event to set height properly after dom loaded to fix content overlap bug on tablet. +// We want height to be accurate as soon as possible *and* afterward, so this lightweight double-check should stay. +setTimeout(() => { + handleResize(true, false); +}, 0);
fix(with-without): tablet height overflow on load; force resize
bolt-design-system_bolt
train
js
39fa9b011ccfebf772ded84658a3fd8775b80b71
diff --git a/core/test/karma.conf.js b/core/test/karma.conf.js index <HASH>..<HASH> 100644 --- a/core/test/karma.conf.js +++ b/core/test/karma.conf.js @@ -88,6 +88,21 @@ module.exports = function(config) { local_safari: { // alias for `Safari` (defined by `karma-safari-launcher`) base: 'Safari', }, + // To use a browser launcher which has `base: 'SauceLabs'`, + // set process.env.SAUCE_USERNAME and process.env.SAUCE_ACCESS_KEY. + // For more information, see https://github.com/karma-runner/karma-sauce-launcher + remote_macos_elcapitan_safari_9: { + base: 'SauceLabs', + platform: 'OS X 10.11', + browserName: 'Safari', + version: '9.0', + }, + remote_macos_elcapitan_safari_10: { + base: 'SauceLabs', + platform: 'OS X 10.11', + browserName: 'Safari', + version: '10.0', + }, //////////////////////////////////////// // Mobile - Android Chrome
feat(test): Add custom browser launchers which launch Safari on remote Mac instance.
OnsenUI_OnsenUI
train
js
0cf580c628a495d77b85e35ed1b9d244e2ec5ae0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -252,7 +252,7 @@ HtmlWebpackPlugin.prototype.executeTemplate = function (templateFunction, chunks .then(function () { var templateParams = { compilation: compilation, - webpack: compilation.getStats(), + webpack: compilation.getStats().toJson(), webpackConfig: compilation.options, htmlWebpackPlugin: { files: assets,
fix(template): prevent undefined error in template loader (#<I>)
jantimon_html-webpack-plugin
train
js
9481fcb830f7af04e4d5c533a407085c2bdc244a
diff --git a/pkg/services/alerting/alert_rule.go b/pkg/services/alerting/alert_rule.go index <HASH>..<HASH> 100644 --- a/pkg/services/alerting/alert_rule.go +++ b/pkg/services/alerting/alert_rule.go @@ -72,7 +72,6 @@ func NewAlertRuleFromDBModel(ruleDef *m.Alert) (*AlertRule, error) { Value: warning.Get("value").MustFloat64(), } - model.Frequency = getTimeDurationStringToSeconds(ruleDef.Settings.Get("frequency").MustString()) model.Transform = ruleDef.Settings.Get("transform").Get("type").MustString() model.TransformParams = *ruleDef.Settings.Get("transform")
fix(alerting): use alert frequency
grafana_grafana
train
go
ff8ee0988c8356decd83e4fd66aae9952f09cc06
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -165,14 +165,12 @@ function tunnelProxy(server, proxy) { dstOptions.port = dstOptions.port || 443; dstOptions.host = dstOptions.hostname; var _headers = extend({}, headers); - if (tunnelPort) { - if (req.clientIp) { - _headers[pluginMgr.CLIENT_IP_HEADER] = req.clientIp; - } - var ruleValue = util.getMatcherValue(_rules.rule); - if (ruleValue) { - _headers[pluginMgr.RULE_VALUE_HEADER] = encodeURIComponent(ruleValue); - } + if (req.clientIp) { + _headers[pluginMgr.CLIENT_IP_HEADER] = req.clientIp; + } + var ruleValue = tunnelPort && util.getMatcherValue(_rules.rule); + if (ruleValue) { + _headers[pluginMgr.RULE_VALUE_HEADER] = encodeURIComponent(ruleValue); } _headers.host = dstOptions.hostname + ':' + (dstOptions.port || 443); dstOptions.headers = _headers;
feat: Send client ip to proxy server
avwo_whistle
train
js
e0f310de8140359a9620598b82d58231904eecbc
diff --git a/src/notebook/components/notebook.js b/src/notebook/components/notebook.js index <HASH>..<HASH> 100644 --- a/src/notebook/components/notebook.js +++ b/src/notebook/components/notebook.js @@ -70,7 +70,7 @@ export function getLanguageMode(notebook: any): string { return language; } -export function scrollToElement(el) { +export function scrollToElement(el: HTMLElement): int { const viewportHeight = window.innerHeight; const viewportOffset = document.body.scrollTop; @@ -91,7 +91,7 @@ export function scrollToElement(el) { const offset = viewportHeight - cellHeight; return cellTop - offset; } - return undefined; + return document.body.scrollTop; } const mapStateToProps = (state: Object) => ({
chore(NotebookTesting): Add flow typing, return scrollTop.
nteract_nteract
train
js
c2c6b70585f3f8ef09fb2e9e3cb36f844ffcff99
diff --git a/src/components/Notification/Notification.js b/src/components/Notification/Notification.js index <HASH>..<HASH> 100644 --- a/src/components/Notification/Notification.js +++ b/src/components/Notification/Notification.js @@ -180,8 +180,6 @@ export class NotificationTextDetails extends Component { export class ToastNotification extends Component { static propTypes = { - children: PropTypes.node, - /** * Specify an optional className to be applied to the notification box */ @@ -327,8 +325,6 @@ export class ToastNotification extends Component { export class InlineNotification extends Component { static propTypes = { - children: PropTypes.node, - /** * Specify an optional className to be applied to the notification box */
refactor(Notification): remove unused props (#<I>)
carbon-design-system_carbon-components-react
train
js
02bbade81a2cfa4961dc09e3449112d4582a2c1d
diff --git a/wandb/apis/public.py b/wandb/apis/public.py index <HASH>..<HASH> 100644 --- a/wandb/apis/public.py +++ b/wandb/apis/public.py @@ -2128,7 +2128,7 @@ class Artifact(object): raise ValueError('Unexpected API result.') - def new_file(self, name): + def new_file(self, name, mode=None): raise ValueError('Cannot add files to an artifact once it has been saved') def add_file(self, path, name=None): diff --git a/wandb/artifacts.py b/wandb/artifacts.py index <HASH>..<HASH> 100644 --- a/wandb/artifacts.py +++ b/wandb/artifacts.py @@ -113,14 +113,14 @@ class Artifact(object): if self._final: raise ValueError('Can\'t add to finalized artifact.') - def new_file(self, name): + def new_file(self, name, mode='w'): self._ensure_can_add() path = os.path.join(self._artifact_dir.name, name.lstrip('/')) if os.path.exists(path): raise ValueError('File with name "%s" already exists' % name) util.mkdir_exists_ok(os.path.dirname(path)) self._added_new = True - return open(path, 'w') + return open(path, mode) def add_file(self, local_path, name=None): self._ensure_can_add()
feat: add custom mode to Artifact.new_file (#<I>) * feat: add custom mode to Artifact.new_file * fix: set default value
wandb_client
train
py,py
830ec9e02d40ba04c7274159ac863df92c687c8d
diff --git a/src/test/java/org/camunda/bpm/model/dmn/util/Java9CDataWhitespaceFilter.java b/src/test/java/org/camunda/bpm/model/dmn/util/Java9CDataWhitespaceFilter.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/camunda/bpm/model/dmn/util/Java9CDataWhitespaceFilter.java +++ b/src/test/java/org/camunda/bpm/model/dmn/util/Java9CDataWhitespaceFilter.java @@ -56,9 +56,12 @@ import org.xmlunit.util.Predicate; */ public class Java9CDataWhitespaceFilter implements Predicate<Node> { + /** + * @return false to remove the node from the comparison + */ @Override public boolean test(Node toTest) { - return isWhitespaceSurroundingCData(toTest); + return !isWhitespaceSurroundingCData(toTest); } private boolean isWhitespaceSurroundingCData(Node node) { @@ -72,13 +75,13 @@ public class Java9CDataWhitespaceFilter implements Predicate<Node> { Node child1 = children.item(1); Node child2 = children.item(2); - return !(isTextNode(child0) && isCDataSection(child1) && isTextNode(child2)); + return isTextNode(child0) && isCDataSection(child1) && isTextNode(child2); } else { - return true; + return false; } } else { - return true; + return false; } }
chore(model-api): simplify boolean expressions related to CAM-<I>
camunda_camunda-dmn-model
train
java
312ff20d52338512e78e907011debd3adafaacce
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,12 @@ from setuptools import setup, find_packages +# read the contents of your README file +from os import path +this_directory = path.abspath(path.dirname(__file__)) +with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: + long_description = f.read() + setup( name="sentry-sdk", version="0.1.0-preview3", @@ -9,7 +15,8 @@ setup( author_email="hello@getsentry.com", url="https://github.com/getsentry/sentry-sdk", description="Python client for Sentry (https://getsentry.com)", - long_description=__doc__, + long_description=long_description, + long_description_content_type='text/markdown', packages=find_packages(exclude=("tests", "tests.*")), zip_safe=False, license="BSD",
fix: fix markdown readme in setup.py
getsentry_sentry-python
train
py
ead6b48cd3b3030521d8be87aa2810abdd079bf5
diff --git a/application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php b/application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php index <HASH>..<HASH> 100644 --- a/application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php +++ b/application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php @@ -85,6 +85,11 @@ class CIPHPUnitTestCase extends PHPUnit_Framework_TestCase chdir(FCPATH); } + public static function tearDownAfterClass() + { + CIPHPUnitTestDbConnectionStore::destory(); + } + /** * Reset CodeIgniter instance and assign new CodeIgniter instance as $this->CI */
fix: call CIPHPUnitTestDbConnectionStore::destory from tearDownAfterClass.
kenjis_ci-phpunit-test
train
php
dfe036520cc183b507cacb7098ccc70217d2a05d
diff --git a/src/commands/build/build.js b/src/commands/build/build.js index <HASH>..<HASH> 100644 --- a/src/commands/build/build.js +++ b/src/commands/build/build.js @@ -68,7 +68,7 @@ const build = async (options, command) => { if (!options.offline) { checkOptions(buildOptions) const { api, site } = command.netlify - const context = { options } + const { context } = options await injectEnv(command, { api, buildOptions, context, site, siteInfo }) }
fix: incorrect destructuring (#<I>)
netlify_cli
train
js
ecd68dbeae8e913d61f619df33615f496c88a896
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,5 @@ module.exports = function(grunt) { + 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), @@ -28,11 +29,15 @@ module.exports = function(grunt) { grunt.registerTask('test', ['shell:test']); - grunt.registerTask('release', 'Build, bump and publish to NPM.', function(type) { - grunt.task.run([ - 'test', - 'bump:' + (type || 'patch'), - 'npm-publish' - ]); - }); + grunt.registerTask( + 'release', + 'Build, bump and publish to NPM.', + function(type) { + grunt.task.run([ + 'test', + 'bump:' + (type || 'patch'), + 'npm-publish' + ]); + } + ); };
chore: fix jshint and jscs for gruntfile
Jimdo_grunt-angular-toolbox
train
js
5786239bcb401b4e0e3097721fd8806a6e7c0c43
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -137,8 +137,8 @@ html_theme_options = { 'github_banner': True, 'show_powered_by': False, 'extra_nav_links': { - 'invenio-records@GitHub': 'http://github.com/inveniosoftware/invenio-records', - 'invenio-records@PyPI': 'http://pypi.python.org/pypi/invenio-records/', + 'invenio-records@GitHub': 'https://github.com/inveniosoftware/invenio-records', + 'invenio-records@PyPI': 'https://pypi.python.org/pypi/invenio-records/', } } @@ -334,3 +334,6 @@ intersphinx_mapping = { 'https://python-jsonschema.readthedocs.io/en/latest', None ) } + +# Autodoc configuraton. +autoclass_content = 'both'
docs: autodoc configuration and HTTPS fix * Replaces HTTP links with HTTPS where possible.
inveniosoftware_invenio-records
train
py
5b39f7a12e429626890d93a364bdb0c7520a6d5c
diff --git a/intranet/apps/users/admin.py b/intranet/apps/users/admin.py index <HASH>..<HASH> 100644 --- a/intranet/apps/users/admin.py +++ b/intranet/apps/users/admin.py @@ -1,5 +1,8 @@ from django.contrib import admin -from ..users.models import User +from ..users.models import User, UserProperties, Course, Section admin.site.register(User) +admin.site.register(UserProperties) +admin.site.register(Course) +admin.site.register(Section)
fix(users): register models
tjcsl_ion
train
py
d5feac10e846ded2aaca4c76a36462ebebbdcde9
diff --git a/src/RedirectConfig.js b/src/RedirectConfig.js index <HASH>..<HASH> 100644 --- a/src/RedirectConfig.js +++ b/src/RedirectConfig.js @@ -37,15 +37,7 @@ class RedirectConfig extends SchemaDerivedConfig { } async match(path) { - return this.redirects.reduce((matched, redirect) => { - if (matched) { - return matched; - } - if (typeof redirect === 'object' && redirect instanceof Redirect) { - return redirect.match(path); - } - return null; - }, null); + return this.redirects.find((redirect) => (typeof redirect === 'object' && redirect instanceof Redirect ? redirect.match(path) : null)).match(path); } }
refactor(redirects): use find instead of reduce
adobe_helix-shared
train
js
0bb6a9245d8e301eaab4553b8cad67b9f828708b
diff --git a/inc/cloner/class-cloner.php b/inc/cloner/class-cloner.php index <HASH>..<HASH> 100644 --- a/inc/cloner/class-cloner.php +++ b/inc/cloner/class-cloner.php @@ -997,8 +997,8 @@ class Cloner { * @return bool Whether or not the book is public and licensed for cloning (or true if the current user is a network administrator and the book is in the current network). */ public function isSourceCloneable( $metadata_license ): bool { - if ( has_filter( 'pb_set_source_clonable' ) ) { - return apply_filters( 'pb_set_source_clonable', [] ); + if ( has_filter( 'pb_set_source_clonable' ) && apply_filters( 'pb_set_source_clonable', [] ) ) { + return true; } $restrictive_licenses = [
fix: improve hook handling for clonable hook (#<I>)
pressbooks_pressbooks
train
php
007282503bb8923cdcb995f76c0ed054fc546151
diff --git a/test/id-utils.spec.js b/test/id-utils.spec.js index <HASH>..<HASH> 100644 --- a/test/id-utils.spec.js +++ b/test/id-utils.spec.js @@ -158,6 +158,7 @@ test('resolveModuleId returns clean id', t => { test('resolveModuleId can work on base with ..', t => { t.equal(resolveModuleId('../foo', './bar'), '../bar'); t.equal(resolveModuleId('../../foo', '../goo/bar'), '../goo/bar'); + t.equal(resolveModuleId('../test/app.spec', '../src/app'), '../src/app'); t.end(); }); @@ -262,6 +263,7 @@ test('relativeModuleId returns clean id', t => { test('relativeModuleId can work on base with ..', t => { t.equal(relativeModuleId('../foo', '../bar'), './bar'); t.equal(relativeModuleId('../../foo', '../goo/bar'), '../goo/bar'); + t.equal(relativeModuleId('../test/app.spec', '../src/app'), '../src/app'); t.end(); });
test: add test coverage on above surface module resolution
dumberjs_dumber-module-loader
train
js
61134120d6d21749224a0ff8b7f65fd1b7c34986
diff --git a/src/Console/CodeAnalyseCommand.php b/src/Console/CodeAnalyseCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/CodeAnalyseCommand.php +++ b/src/Console/CodeAnalyseCommand.php @@ -105,9 +105,16 @@ final class CodeAnalyseCommand extends Command } } + $paths = array_map( + function ($path) { + return starts_with($path, DIRECTORY_SEPARATOR) ? $path : $this->laravel->basePath($path); + }, + explode(',', $this->option('paths')) + ); + $params = [ $this->command(), - $this->option('paths'), + implode(' ', $paths), $options, ];
feat: paths option defaults to laravel base path
nunomaduro_larastan
train
php
bae72de189b06b97a3b353e8e0612e3833786c1a
diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index <HASH>..<HASH> 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -62,6 +62,7 @@ public class BranchSDK extends CordovaPlugin { this.activity = this.cordova.getActivity(); + Branch.disableInstantDeepLinking(true); Branch.getAutoInstance(this.activity.getApplicationContext()); }
fix: correction for Android SDK <I>
BranchMetrics_cordova-ionic-phonegap-branch-deep-linking
train
java
1fe23d7b68e18a240769bc618b916b63d6a282fb
diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index <HASH>..<HASH> 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -55,7 +55,7 @@ export class MdTabs { if (indicatorRight.indexOf('-') === 0) { $('.indicator', this.element).css('right', 0); } - }, 320); + }, 310); let href = e.target.getAttribute('href'); fireMaterializeEvent(this.element, 'selected', href); }
refactor(md-tabs): slightly less dirty tab styling fix, ref #<I>
aurelia-ui-toolkits_aurelia-materialize-bridge
train
js
311bceb6278060b85f3a42dbba70487ea31ede41
diff --git a/test/openscap_test.rb b/test/openscap_test.rb index <HASH>..<HASH> 100644 --- a/test/openscap_test.rb +++ b/test/openscap_test.rb @@ -19,4 +19,12 @@ class TestOscapVersion < Test::Unit::TestCase OpenSCAP.oscap_cleanup assert version.include?(".") end + + def test_double_read_error + assert ! OpenSCAP.error? + msg = OpenSCAP.get_full_error + assert msg.nil? + msg = OpenSCAP.get_full_error + assert msg.nil? + end end
test: Make sure the full error can be always read
OpenSCAP_ruby-openscap
train
rb
fa78da936358e587c66e19caec3e790197fe698b
diff --git a/tests/specs/scoped.js b/tests/specs/scoped.js index <HASH>..<HASH> 100644 --- a/tests/specs/scoped.js +++ b/tests/specs/scoped.js @@ -200,6 +200,22 @@ test('scoped Store .findOrAdd([object, object])', function (t) { .catch(t.fail) }) +test('scoped Store .findOrAdd() with missing id throws an error', function (t) { + t.plan(1) + + var store = new Store('test-db-scoped-find-add', merge({remote: 'test-db-scoped-find-add'}, options)) + var testStore = store('test') + + var testItem = { + foo: 'bar1' + } + + testStore.findOrAdd(testItem) + .catch(function (err) { + t.is(err.message, 'Missing ID', 'error has correct message') + }) +}) + test('scoped Store .update()', function (t) { t.plan(2)
test: improve tests for findOrAdd() errors
hoodiehq_hoodie-store-client
train
js
750f440b1a691b5d6ac2ee84f79d6ee1938eefe4
diff --git a/fastly/models.py b/fastly/models.py index <HASH>..<HASH> 100644 --- a/fastly/models.py +++ b/fastly/models.py @@ -28,6 +28,9 @@ class Model(object): return self.__class__.query(self.conn, self.COLLECTION_PATTERN, method, suffix, body, **self.attrs) def save(self): + if self._original_attrs == self.attrs: + return False + if self._original_attrs: out = {} for k in self.attrs: @@ -35,13 +38,13 @@ class Model(object): out[k] = self.attrs[k] params_str = urlencode(out) resp, data = self._query('PUT', body=params_str) - else: params_str = urlencode(self.attrs) resp, data = self._collection_query('POST', body=params_str) self._original_attrs = data self.attrs = data + return True @classmethod
fix(models): Do not perform save if `attrs` is unchanged
fastly_fastly-py
train
py
d027ceb301d8c3d1d9e92ca3827687b331296dd2
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -46,6 +46,8 @@ var cleanUp = function(runner, log) { util.puts('Shutting down selenium standalone server'); server.stop(); } + + process.exit(passed? 0 : 1); }; var printVersion = function () {
fix(cleanUp): Added step to exit process with error code if tests did not pass.
angular_protractor
train
js
47b65d5792529859595ff8e195fab09e321871cf
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/webdiff/WebDiff.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/webdiff/WebDiff.java index <HASH>..<HASH> 100644 --- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/webdiff/WebDiff.java +++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/webdiff/WebDiff.java @@ -91,7 +91,7 @@ public class WebDiff extends AbstractDiffClient<WebDiff.Options> { if (comparator.isDirMode()) response.redirect("/list"); else - response.redirect("/vanilla-diff/0"); + response.redirect("/monaco-diff/0"); return ""; }); get("/list", (request, response) -> {
fix: now monaco diff is the default client
GumTreeDiff_gumtree
train
java