From 49d227e2c87f507a081a430a15c6ebcf38525e52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:13:09 +0000 Subject: [PATCH 001/112] Bump rubocop from 1.60.2 to 1.61.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.60.2 to 1.61.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.60.2...v1.61.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 65265cba..0f543f56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -20,6 +20,7 @@ GEM parser (3.3.0.5) ast (~> 2.4.1) racc + prism (0.24.0) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -31,7 +32,7 @@ GEM rake (13.1.0) regexp_parser (2.9.0) rexml (3.2.6) - rubocop (1.60.2) + rubocop (1.61.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -42,8 +43,9 @@ GEM rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.0) + parser (>= 3.3.0.4) + prism (>= 0.24.0) ruby-progressbar (1.13.0) unicode-display_width (2.5.0) From 74b17ccb8d633a82c70aa4ee252cc5f2fd2d33f1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:13:56 +0000 Subject: [PATCH 002/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 47 ++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 40526db9..b8f8fbf5 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -400,7 +400,9 @@ Layout/ElseAlignment: Layout/EmptyComment: Description: Checks empty comment. Enabled: true + AutoCorrect: contextual VersionAdded: '0.53' + VersionChanged: '1.61' AllowBorderComment: true AllowMarginComment: true Layout/EmptyLineAfterGuardClause: @@ -1310,15 +1312,17 @@ Lint/EmptyConditionalBody: Description: Checks for the presence of `if`, `elsif` and `unless` branches without a body. Enabled: false + AutoCorrect: contextual SafeAutoCorrect: false AllowComments: true VersionAdded: '0.89' - VersionChanged: '1.34' + VersionChanged: '1.61' Lint/EmptyEnsure: Description: Checks for empty ensure block. Enabled: true + AutoCorrect: contextual VersionAdded: '0.10' - VersionChanged: '0.48' + VersionChanged: '1.61' Lint/EmptyExpression: Description: Checks for empty expressions. Enabled: false @@ -1336,8 +1340,9 @@ Lint/EmptyInPattern: Lint/EmptyInterpolation: Description: Checks for empty string interpolation. Enabled: true + AutoCorrect: contextual VersionAdded: '0.20' - VersionChanged: '0.45' + VersionChanged: '1.61' Lint/EmptyWhen: Description: Checks for `when` branches with empty bodies. Enabled: false @@ -1773,7 +1778,9 @@ Lint/TopLevelReturnWithArgument: Lint/TrailingCommaInAttributeDeclaration: Description: Checks for trailing commas in attribute declarations. Enabled: false + AutoCorrect: contextual VersionAdded: '0.90' + VersionChanged: '1.61' Lint/TripleQuotes: Description: Checks for useless triple quote constructs. Enabled: false @@ -1825,16 +1832,18 @@ Lint/UnusedBlockArgument: Description: Checks for unused block arguments. StyleGuide: "#underscore-unused-vars" Enabled: true + AutoCorrect: contextual VersionAdded: '0.21' - VersionChanged: '0.22' + VersionChanged: '1.61' IgnoreEmptyBlocks: true AllowUnusedKeywordArguments: false Lint/UnusedMethodArgument: Description: Checks for unused method arguments. StyleGuide: "#underscore-unused-vars" Enabled: false + AutoCorrect: contextual VersionAdded: '0.21' - VersionChanged: '0.81' + VersionChanged: '1.61' AllowUnusedKeywordArguments: false IgnoreEmptyMethods: true IgnoreNotImplementedMethods: true @@ -1853,16 +1862,18 @@ Lint/UriRegexp: Lint/UselessAccessModifier: Description: Checks for useless access modifiers. Enabled: true + AutoCorrect: contextual VersionAdded: '0.20' - VersionChanged: '0.83' + VersionChanged: '1.61' ContextCreatingMethods: [] MethodCreatingMethods: [] Lint/UselessAssignment: Description: Checks for useless assignment to a local variable. StyleGuide: "#underscore-unused-vars" Enabled: true + AutoCorrect: contextual VersionAdded: '0.11' - VersionChanged: '1.51' + VersionChanged: '1.61' SafeAutoCorrect: false Lint/UselessElseWithoutRescue: Description: Checks for useless `else` in `begin..end` without `rescue`. @@ -1872,8 +1883,9 @@ Lint/UselessElseWithoutRescue: Lint/UselessMethodDefinition: Description: Checks for useless method definitions. Enabled: false + AutoCorrect: contextual VersionAdded: '0.90' - VersionChanged: '0.91' + VersionChanged: '1.61' Safe: false Lint/UselessRescue: Description: Checks for useless `rescue`s. @@ -1892,12 +1904,16 @@ Lint/UselessSetterCall: Lint/UselessTimes: Description: Checks for useless `Integer#times` calls. Enabled: false - VersionAdded: '0.91' Safe: false + AutoCorrect: contextual + VersionAdded: '0.91' + VersionChanged: '1.61' Lint/Void: Description: Possible use of operator/literal/variable in void context. Enabled: true + AutoCorrect: contextual VersionAdded: '0.9' + VersionChanged: '1.61' CheckForMethodsWithNoSideEffects: false Metrics/AbcSize: Description: A calculated magnitude based on number of assignments, branches, and @@ -2756,8 +2772,9 @@ Style/EmptyCaseCondition: Style/EmptyElse: Description: Avoid empty else-clauses. Enabled: true + AutoCorrect: contextual VersionAdded: '0.28' - VersionChanged: '0.32' + VersionChanged: '1.61' EnforcedStyle: both SupportedStyles: - empty @@ -2767,7 +2784,9 @@ Style/EmptyElse: Style/EmptyHeredoc: Description: Checks for using empty heredoc to reduce redundancy. Enabled: true + AutoCorrect: contextual VersionAdded: '1.32' + VersionChanged: '1.61' Style/EmptyLambdaParameter: Description: Omit parens for empty lambda parameters. Enabled: false @@ -2782,7 +2801,9 @@ Style/EmptyMethod: Description: Checks the formatting of empty method definitions. StyleGuide: "#no-single-line-methods" Enabled: false + AutoCorrect: contextual VersionAdded: '0.46' + VersionChanged: '1.61' EnforcedStyle: compact SupportedStyles: - compact @@ -3662,8 +3683,9 @@ Style/RaiseArgs: Description: Checks the arguments passed to raise/fail. StyleGuide: "#exception-class-messages" Enabled: true + Safe: false VersionAdded: '0.14' - VersionChanged: '1.2' + VersionChanged: '1.61' EnforcedStyle: exploded SupportedStyles: - compact @@ -3773,10 +3795,11 @@ Style/RedundantHeredocDelimiterQuotes: Style/RedundantInitialize: Description: Checks for redundant `initialize` methods. Enabled: false + AutoCorrect: contextual Safe: false AllowComments: true VersionAdded: '1.27' - VersionChanged: '1.28' + VersionChanged: '1.61' Style/RedundantInterpolation: Description: Checks for strings that are just an interpolated expression. Enabled: true From a3ac8a6691904685f7295f36780dd62a758afcdd Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 29 Feb 2024 10:16:02 -0500 Subject: [PATCH 003/112] Trigger Dependabot daily for gems instead of weekly We want to know about new RuboCop versions in a timely manner, and we don't have many dependencies, so we might as well check all of them daily. --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f74e7afa..f8ff2415 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ updates: directory: '/' versioning-strategy: increase schedule: - interval: weekly + interval: daily - package-ecosystem: github-actions directory: '/' From d2bed04980ee7b0d0101b095dbfcefdffd1d1ece Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:20:19 +0000 Subject: [PATCH 004/112] Bump the npm group with 2 updates Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [sass](https://github.com/sass/dart-sass). Updates `eslint` from 8.56.0 to 8.57.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0) Updates `sass` from 1.70.0 to 1.71.1 - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.70.0...1.71.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm ... Signed-off-by: dependabot[bot] --- package-lock.json | 80 +++++++++++++++++++++++------------------------ package.json | 4 +-- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69ab335f..26813781 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,14 +11,14 @@ "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "@fortawesome/fontawesome-free": "^6.5.1", "bulma": "^0.9.4", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-standard": "^5.0.0", "markdown-it-anchor": "^8.6.7", - "sass": "^1.70.0" + "sass": "^1.71.1" } }, "node_modules/@11ty/dependency-tree": { @@ -257,9 +257,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -276,13 +276,13 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -303,9 +303,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@iarna/toml": { @@ -1198,16 +1198,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -3853,9 +3853,9 @@ } }, "node_modules/sass": { - "version": "1.70.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.70.0.tgz", - "integrity": "sha512-uUxNQ3zAHeAx5nRFskBnrWzDUJrrvpCPD5FNAoRvTi0WwremlheES3tg+56PaVtCs5QDRX5CBLxxKMDJMEa1WQ==", + "version": "1.71.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.1.tgz", + "integrity": "sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -4645,9 +4645,9 @@ } }, "@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true }, "@fortawesome/fontawesome-free": { @@ -4657,13 +4657,13 @@ "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" } }, @@ -4674,9 +4674,9 @@ "dev": true }, "@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "@iarna/toml": { @@ -5351,16 +5351,16 @@ "dev": true }, "eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -7296,9 +7296,9 @@ } }, "sass": { - "version": "1.70.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.70.0.tgz", - "integrity": "sha512-uUxNQ3zAHeAx5nRFskBnrWzDUJrrvpCPD5FNAoRvTi0WwremlheES3tg+56PaVtCs5QDRX5CBLxxKMDJMEa1WQ==", + "version": "1.71.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.1.tgz", + "integrity": "sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", diff --git a/package.json b/package.json index ec21ec4f..1be58cb7 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,13 @@ "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "@fortawesome/fontawesome-free": "^6.5.1", "bulma": "^0.9.4", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-standard": "^5.0.0", "markdown-it-anchor": "^8.6.7", - "sass": "^1.70.0" + "sass": "^1.71.1" } } From 48a6851b63960cad5376d85c6dc63d9d020e080a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:46:05 +0000 Subject: [PATCH 005/112] Bump rubocop from 1.61.0 to 1.62.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.61.0 to 1.62.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.61.0...v1.62.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0f543f56..2a299ada 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -20,7 +20,6 @@ GEM parser (3.3.0.5) ast (~> 2.4.1) racc - prism (0.24.0) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -32,7 +31,7 @@ GEM rake (13.1.0) regexp_parser (2.9.0) rexml (3.2.6) - rubocop (1.61.0) + rubocop (1.62.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -40,12 +39,11 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.0) + rubocop-ast (1.31.1) parser (>= 3.3.0.4) - prism (>= 0.24.0) ruby-progressbar (1.13.0) unicode-display_width (2.5.0) From fdeea57c755157addb652b015ddb38555d9fafd9 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:46:42 +0000 Subject: [PATCH 006/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index b8f8fbf5..6a5be943 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -80,6 +80,7 @@ AllCops: CacheRootDirectory: AllowSymlinksInCacheRootDirectory: false TargetRubyVersion: + ParserEngine: parser_whitequark SuggestExtensions: rubocop-rails: - rails From 0a03d1e3fb5a0d4a16cce32495012dc46c343883 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:15:54 +0000 Subject: [PATCH 007/112] Bump rubocop from 1.62.0 to 1.62.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.62.0 to 1.62.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.62.0...v1.62.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2a299ada..1e2e0cbb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,7 +31,7 @@ GEM rake (13.1.0) regexp_parser (2.9.0) rexml (3.2.6) - rubocop (1.62.0) + rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -42,7 +42,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.1) + rubocop-ast (1.31.2) parser (>= 3.3.0.4) ruby-progressbar (1.13.0) unicode-display_width (2.5.0) From fefa223cc658287fd18c6618683896a0bdb0acde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:36:40 +0000 Subject: [PATCH 008/112] Bump minitest from 5.22.2 to 5.22.3 Bumps [minitest](https://github.com/minitest/minitest) from 5.22.2 to 5.22.3. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/commits) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1e2e0cbb..42b6c091 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM json (2.7.1) language_server-protocol (3.17.0.3) method_source (1.0.0) - minitest (5.22.2) + minitest (5.22.3) parallel (1.24.0) parser (3.3.0.5) ast (~> 2.4.1) From d4fd1cfc654d053ab7eff8ecaf770cc65c6c64c7 Mon Sep 17 00:00:00 2001 From: Alex Rocha Date: Mon, 25 Mar 2024 10:24:24 -0700 Subject: [PATCH 009/112] Centralize ruby version to `.ruby-version` The `.ruby-version` file is the ecosystem standard for defining a Ruby version. This commit adds the `.ruby-version` file and removes all other references as they will read from this file. --- .github/workflows/ruby.yml | 2 +- Gemfile.lock | 4 ++-- rubocop-cli.yml | 3 --- rubocop-shopify.gemspec | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index c164f77b..f6d32137 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: gemfile: [Gemfile, gemfiles/minimum_rubocop.gemfile] - ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"] + ruby: ["3.0", "3.1", "3.2", "3.3"] env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/Gemfile.lock b/Gemfile.lock index 42b6c091..46edca23 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -20,7 +20,7 @@ GEM parser (3.3.0.5) ast (~> 2.4.1) racc - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.10.1) @@ -59,4 +59,4 @@ DEPENDENCIES rubocop-shopify! BUNDLED WITH - 2.3.25 + 2.5.3 diff --git a/rubocop-cli.yml b/rubocop-cli.yml index 3b9435b3..fb7babb9 100644 --- a/rubocop-cli.yml +++ b/rubocop-cli.yml @@ -10,9 +10,6 @@ AllCops: Exclude: - 'vendor/**/*' - # Mac OS Catalina ships with 2.6.3 - TargetRubyVersion: 2.6 - # We disable this at entrypoint. # Due to CLI apps being invoked via an entry point, # we can exclude this from all files diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index 41c02e8a..cb7b1a13 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| "allowed_push_host" => "https://rubygems.org", } - s.required_ruby_version = ">= 2.7.0" + s.required_ruby_version = ">= 3.0.0" s.add_dependency("rubocop", "~> 1.51") end From 637be8bfbebd14bf13f83b565bee0a17ee88f67b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:42:53 +0000 Subject: [PATCH 010/112] Bump rake from 13.1.0 to 13.2.0 Bumps [rake](https://github.com/ruby/rake) from 13.1.0 to 13.2.0. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.1.0...v13.2.0) --- updated-dependencies: - dependency-name: rake dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 46edca23..9c1db716 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,7 +28,7 @@ GEM pry (>= 0.13, < 0.15) racc (1.7.3) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.0) regexp_parser (2.9.0) rexml (3.2.6) rubocop (1.62.1) From 4b26394461e3d8d0a85617273ccb0e4095762e25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:17:00 +0000 Subject: [PATCH 011/112] Bump rake from 13.2.0 to 13.2.1 Bumps [rake](https://github.com/ruby/rake) from 13.2.0 to 13.2.1. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.0...v13.2.1) --- updated-dependencies: - dependency-name: rake dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9c1db716..18c82271 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,7 +28,7 @@ GEM pry (>= 0.13, < 0.15) racc (1.7.3) rainbow (3.1.1) - rake (13.2.0) + rake (13.2.1) regexp_parser (2.9.0) rexml (3.2.6) rubocop (1.62.1) From 55c1af8630ea21949964916c8321200c32696354 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:40:33 +0000 Subject: [PATCH 012/112] Bump rubocop from 1.62.1 to 1.63.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.62.1 to 1.63.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.62.1...v1.63.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 18c82271..17c2595d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ GEM byebug (11.1.3) coderay (1.1.3) diffy (3.4.2) - json (2.7.1) + json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) minitest (5.22.3) @@ -31,7 +31,7 @@ GEM rake (13.2.1) regexp_parser (2.9.0) rexml (3.2.6) - rubocop (1.62.1) + rubocop (1.63.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) From ac2a83e3e566510e4c052592a9b94116320601b0 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:41:09 +0000 Subject: [PATCH 013/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 6a5be943..33bce83d 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -86,7 +86,6 @@ AllCops: - rails rubocop-rspec: - rspec - - rspec-rails rubocop-minitest: - minitest rubocop-sequel: @@ -100,6 +99,8 @@ AllCops: rubocop-factory_bot: - factory_bot - factory_bot_rails + rubocop-rspec_rails: + - rspec-rails ActiveSupportExtensionsEnabled: false Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. @@ -1166,7 +1167,7 @@ Lint/Debugger: Description: Check for debugger calls. Enabled: true VersionAdded: '0.14' - VersionChanged: '1.46' + VersionChanged: '1.63' DebuggerMethods: Kernel: - binding.irb @@ -1177,8 +1178,14 @@ Lint/Debugger: - Kernel.byebug - Kernel.remote_byebug Capybara: + - page.save_and_open_page + - page.save_and_open_screenshot + - page.save_page + - page.save_screenshot - save_and_open_page - save_and_open_screenshot + - save_page + - save_screenshot debug.rb: - binding.b - binding.break @@ -1200,6 +1207,11 @@ Lint/Debugger: - jard WebConsole: - binding.console + DebuggerRequires: + debug.rb: + - debug/open + - debug/open_nonstop + - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. Enabled: true @@ -2071,7 +2083,8 @@ Naming/FileName: Enabled: true VersionAdded: '0.50' VersionChanged: '1.23' - Exclude: [] + Exclude: + - "/Rakefile.rb" ExpectMatchingDefinition: false CheckDefinitionPathHierarchy: true CheckDefinitionPathHierarchyRoots: @@ -3212,6 +3225,13 @@ Style/MapCompactWithConditionalBlock: Description: Prefer `select` or `reject` over `map { ... }.compact`. Enabled: false VersionAdded: '1.30' +Style/MapIntoArray: + Description: Checks for usages of `each` with `<<`, `push`, or `append` which can + be replaced by `map`. + StyleGuide: "#functional-code" + Enabled: pending + VersionAdded: '1.63' + Safe: false Style/MapToHash: Description: Prefer `to_h` with a block over `map.to_h`. Enabled: false From 7a66ba604318c8d923fb8b16600baef0988285a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:45:27 +0000 Subject: [PATCH 014/112] Bump peaceiris/actions-gh-pages from 3.9.3 to 4.0.0 in the actions group Bumps the actions group with 1 update: [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages). Updates `peaceiris/actions-gh-pages` from 3.9.3 to 4.0.0 - [Release notes](https://github.com/peaceiris/actions-gh-pages/releases) - [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.3...v4.0.0) --- updated-dependencies: - dependency-name: peaceiris/actions-gh-pages dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index a78efaab..b4beee36 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -25,7 +25,7 @@ jobs: run: npm run build - name: Deploy - uses: peaceiris/actions-gh-pages@v3.9.3 + uses: peaceiris/actions-gh-pages@v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_site From 17cf18406c1e5d249546864fb3a2fa1920ad8ad7 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 9 Apr 2024 13:54:36 -0400 Subject: [PATCH 015/112] Disable `Style/MapIntoArray` While preferring `.map { ... }` vs `a = []; b.each { a << ... }` makes sense, this cop has lots of gotchas, so we'll probably have to evaluate it's false positive rate to determine if we should enable it or not. --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 1360af9c..dac44507 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -628,6 +628,11 @@ Style/MagicCommentFormat: Style/MapCompactWithConditionalBlock: Enabled: false +<% if rubocop_version >= "1.63" %> +Style/MapIntoArray: + Enabled: false +<% end %> + Style/MapToHash: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 33bce83d..01c09cb6 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -3229,7 +3229,7 @@ Style/MapIntoArray: Description: Checks for usages of `each` with `<<`, `push`, or `append` which can be replaced by `map`. StyleGuide: "#functional-code" - Enabled: pending + Enabled: false VersionAdded: '1.63' Safe: false Style/MapToHash: From 9c2bc69782487f0dd72ac1b6ec1c8e6a9e27a616 Mon Sep 17 00:00:00 2001 From: Tobi Lutke Date: Tue, 30 Apr 2024 09:47:09 -0400 Subject: [PATCH 016/112] keep linting to code this is coming from a good place, but is not within the scope of what a linter should do --- rubocop.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 1360af9c..23a5826d 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -389,21 +389,6 @@ Naming/HeredocDelimiterCase: Naming/HeredocDelimiterNaming: Enabled: false -Naming/InclusiveLanguage: - Enabled: true - FlaggedTerms: - master: - Suggestions: - - main - - primary - - leader - AllowedRegex: - - !ruby/regexp '/master[_\s\.]key/' # Rails master key - - !ruby/regexp /\w*:\/\/\S+/ # URLs (e.g. https://github.com/org/repo/blob/master/README.md) - - !ruby/regexp '/(?:blob|tree)/master/' # e.g. github.com/org/repo/blob/master/README.md, without https:// - - !ruby/regexp '/origin[ \/]master/' # Legacy default git branch name - - !ruby/regexp '/(?<=[a-z])master|master(?=[a-z])/' # "master" substring within a longer word - Naming/MemoizedInstanceVariableName: Enabled: false From 910e9ff1d053e122f5be162cf70791c7d369c1ec Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:47:51 +0000 Subject: [PATCH 017/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 6a5be943..78bb5d01 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2141,7 +2141,7 @@ Naming/HeredocDelimiterNaming: - !ruby/regexp /(^|\s)(EO[A-Z]{1}|END)(\s|$)/i Naming/InclusiveLanguage: Description: Recommend the use of inclusive language instead of problematic terms. - Enabled: true + Enabled: false VersionAdded: '1.18' VersionChanged: '1.49' CheckIdentifiers: true @@ -2168,17 +2168,6 @@ Naming/InclusiveLanguage: - replica - secondary - follower - master: - Suggestions: - - main - - primary - - leader - AllowedRegex: - - !ruby/regexp /master[_\s\.]key/ - - !ruby/regexp /\w*:\/\/\S+/ - - !ruby/regexp /(?:blob|tree)\/master/ - - !ruby/regexp /origin[ \/]master/ - - !ruby/regexp /(?<=[a-z])master|master(?=[a-z])/ Naming/MemoizedInstanceVariableName: Description: Memoized method name should match memo instance variable name. Enabled: false From 1da41eb00454e52eee3e2e2df3fb298b885a6660 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 09:46:31 +0000 Subject: [PATCH 018/112] Bump ejs from 3.1.9 to 3.1.10 in the npm_and_yarn group Bumps the npm_and_yarn group with 1 update: [ejs](https://github.com/mde/ejs). Updates `ejs` from 3.1.9 to 3.1.10 - [Release notes](https://github.com/mde/ejs/releases) - [Commits](https://github.com/mde/ejs/compare/v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 26813781..474c8a80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1051,9 +1051,9 @@ "dev": true }, "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "dependencies": { "jake": "^10.8.5" @@ -5237,9 +5237,9 @@ "dev": true }, "ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "requires": { "jake": "^10.8.5" From 5f3b700a674dd7e977657c7c42d9fa4f01ac41ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 13:52:19 +0000 Subject: [PATCH 019/112] Bump rubocop from 1.63.0 to 1.63.4 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.63.0 to 1.63.4. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.63.0...v1.63.4) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 17c2595d..ab1f1c7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM method_source (1.0.0) minitest (5.22.3) parallel (1.24.0) - parser (3.3.0.5) + parser (3.3.1.0) ast (~> 2.4.1) racc pry (0.14.2) @@ -31,7 +31,7 @@ GEM rake (13.2.1) regexp_parser (2.9.0) rexml (3.2.6) - rubocop (1.63.0) + rubocop (1.63.4) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -42,8 +42,8 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) unicode-display_width (2.5.0) From 232cddb7ad8119e10a8b0b91bf1b9d0084bb5440 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 13:52:51 +0000 Subject: [PATCH 020/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index ad6f116d..c8c06f9b 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1210,7 +1210,6 @@ Lint/Debugger: DebuggerRequires: debug.rb: - debug/open - - debug/open_nonstop - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. From d84680b5cf445286b1db6efc2fa1e5b305500e15 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 9 May 2024 13:40:17 -0400 Subject: [PATCH 021/112] Skip `rubocop` patch version updates We respond to RuboCop updates by updating our config accordingly (typically triaging new cops or changes to default config). Since patch version updates shouldn't contain any such changes, we should be able to skip them and avoid the toil of triaging the PRs and audit them when compiling release notes. --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f8ff2415..31e033d2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,10 @@ updates: versioning-strategy: increase schedule: interval: daily + ignore: + - dependency-name: "rubocop" + # We only care about versions that might change config + update-types: ["version-update:semver-patch"] - package-ecosystem: github-actions directory: '/' From 85f3312fabf53b4491483542f419be069b081635 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 28 May 2024 13:46:45 -0400 Subject: [PATCH 022/112] Enable `Style/MixinUsage` https://docs.rubocop.org/rubocop/cops_style.html#stylemixinusage --- rubocop.yml | 3 --- test/fixtures/full_config.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index ffe30c0c..6f6543ee 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -645,9 +645,6 @@ Style/MinMaxComparison: Style/MixinGrouping: Enabled: false -Style/MixinUsage: - Enabled: false - Style/ModuleFunction: EnforcedStyle: extend_self diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index c8c06f9b..fef84296 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -3320,7 +3320,7 @@ Style/MixinGrouping: - grouped Style/MixinUsage: Description: Checks that `include`, `extend` and `prepend` exists at the top level. - Enabled: false + Enabled: true VersionAdded: '0.51' Style/ModuleFunction: Description: Checks for usage of `extend self` in modules. From 9f925e2b1865bfe376a91009088997f04858d8ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 07:14:09 +0000 Subject: [PATCH 023/112] Bump the npm_and_yarn group with 3 updates Bumps the npm_and_yarn group with 3 updates: [braces](https://github.com/micromatch/braces), [pug](https://github.com/pugjs/pug) and [ws](https://github.com/websockets/ws). Updates `braces` from 3.0.2 to 3.0.3 - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) Updates `pug` from 3.0.2 to 3.0.3 - [Release notes](https://github.com/pugjs/pug/releases) - [Commits](https://github.com/pugjs/pug/compare/pug@3.0.2...pug@3.0.3) Updates `ws` from 8.13.0 to 8.17.1 - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.13.0...8.17.1) --- updated-dependencies: - dependency-name: braces dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: pug dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: ws dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- package-lock.json | 100 +++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 474c8a80..dcda2f28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -780,12 +780,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1029,7 +1029,7 @@ "node_modules/doctypes": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", - "integrity": "sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=", + "integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==", "dev": true }, "node_modules/domelementtype": { @@ -1907,9 +1907,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -2709,7 +2709,7 @@ "node_modules/js-stringify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", - "integrity": "sha1-Fzb939lyTyijaCrcYjCufk6Weds=", + "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==", "dev": true }, "node_modules/js-yaml": { @@ -3512,12 +3512,12 @@ "dev": true }, "node_modules/pug": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/pug/-/pug-3.0.2.tgz", - "integrity": "sha512-bp0I/hiK1D1vChHh6EfDxtndHji55XP/ZJKwsRqrz6lRia6ZC2OZbdAymlxdVFwd1L70ebrVJw4/eZ79skrIaw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pug/-/pug-3.0.3.tgz", + "integrity": "sha512-uBi6kmc9f3SZ3PXxqcHiUZLmIXgfgWooKWXcwSGwQd2Zi5Rb0bT14+8CJjJgI8AB+nndLaNgHGrcc6bPIB665g==", "dev": true, "dependencies": { - "pug-code-gen": "^3.0.2", + "pug-code-gen": "^3.0.3", "pug-filters": "^4.0.0", "pug-lexer": "^5.0.1", "pug-linker": "^4.0.0", @@ -3539,25 +3539,25 @@ } }, "node_modules/pug-code-gen": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.2.tgz", - "integrity": "sha512-nJMhW16MbiGRiyR4miDTQMRWDgKplnHyeLvioEJYbk1RsPI3FuA3saEP8uwnTb2nTJEKBU90NFVWJBk4OU5qyg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.3.tgz", + "integrity": "sha512-cYQg0JW0w32Ux+XTeZnBEeuWrAY7/HNE6TWnhiHGnnRYlCgyAUPoyh9KzCMa9WhcJlJ1AtQqpEYHc+vbCzA+Aw==", "dev": true, "dependencies": { "constantinople": "^4.0.1", "doctypes": "^1.1.0", "js-stringify": "^1.0.2", "pug-attrs": "^3.0.0", - "pug-error": "^2.0.0", - "pug-runtime": "^3.0.0", + "pug-error": "^2.1.0", + "pug-runtime": "^3.0.1", "void-elements": "^3.1.0", "with": "^7.0.0" } }, "node_modules/pug-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.0.0.tgz", - "integrity": "sha512-sjiUsi9M4RAGHktC1drQfCr5C5eriu24Lfbt4s+7SykztEOwVZtbFk1RRq0tzLxcMxMYTBR+zMQaG07J/btayQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.1.0.tgz", + "integrity": "sha512-lv7sU9e5Jk8IeUheHata6/UThZ7RK2jnaaNztxfPYUY+VxZyk/ePVaNZ/vwmH8WqGvDz3LrNYt/+gA55NDg6Pg==", "dev": true }, "node_modules/pug-filters": { @@ -4348,7 +4348,7 @@ "node_modules/void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", - "integrity": "sha1-YU9/v42AHwu18GYfWy9XhXUOTwk=", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4432,9 +4432,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" @@ -5036,12 +5036,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "builtins": { @@ -5221,7 +5221,7 @@ "doctypes": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", - "integrity": "sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=", + "integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==", "dev": true }, "domelementtype": { @@ -5853,9 +5853,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -6426,7 +6426,7 @@ "js-stringify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", - "integrity": "sha1-Fzb939lyTyijaCrcYjCufk6Weds=", + "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==", "dev": true }, "js-yaml": { @@ -7033,12 +7033,12 @@ "dev": true }, "pug": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/pug/-/pug-3.0.2.tgz", - "integrity": "sha512-bp0I/hiK1D1vChHh6EfDxtndHji55XP/ZJKwsRqrz6lRia6ZC2OZbdAymlxdVFwd1L70ebrVJw4/eZ79skrIaw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pug/-/pug-3.0.3.tgz", + "integrity": "sha512-uBi6kmc9f3SZ3PXxqcHiUZLmIXgfgWooKWXcwSGwQd2Zi5Rb0bT14+8CJjJgI8AB+nndLaNgHGrcc6bPIB665g==", "dev": true, "requires": { - "pug-code-gen": "^3.0.2", + "pug-code-gen": "^3.0.3", "pug-filters": "^4.0.0", "pug-lexer": "^5.0.1", "pug-linker": "^4.0.0", @@ -7060,25 +7060,25 @@ } }, "pug-code-gen": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.2.tgz", - "integrity": "sha512-nJMhW16MbiGRiyR4miDTQMRWDgKplnHyeLvioEJYbk1RsPI3FuA3saEP8uwnTb2nTJEKBU90NFVWJBk4OU5qyg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.3.tgz", + "integrity": "sha512-cYQg0JW0w32Ux+XTeZnBEeuWrAY7/HNE6TWnhiHGnnRYlCgyAUPoyh9KzCMa9WhcJlJ1AtQqpEYHc+vbCzA+Aw==", "dev": true, "requires": { "constantinople": "^4.0.1", "doctypes": "^1.1.0", "js-stringify": "^1.0.2", "pug-attrs": "^3.0.0", - "pug-error": "^2.0.0", - "pug-runtime": "^3.0.0", + "pug-error": "^2.1.0", + "pug-runtime": "^3.0.1", "void-elements": "^3.1.0", "with": "^7.0.0" } }, "pug-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.0.0.tgz", - "integrity": "sha512-sjiUsi9M4RAGHktC1drQfCr5C5eriu24Lfbt4s+7SykztEOwVZtbFk1RRq0tzLxcMxMYTBR+zMQaG07J/btayQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.1.0.tgz", + "integrity": "sha512-lv7sU9e5Jk8IeUheHata6/UThZ7RK2jnaaNztxfPYUY+VxZyk/ePVaNZ/vwmH8WqGvDz3LrNYt/+gA55NDg6Pg==", "dev": true }, "pug-filters": { @@ -7663,7 +7663,7 @@ "void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", - "integrity": "sha1-YU9/v42AHwu18GYfWy9XhXUOTwk=", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", "dev": true }, "which": { @@ -7726,9 +7726,9 @@ "dev": true }, "ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "requires": {} }, From 0c770699e0207628d28a85d655fb1707cf919a3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:09:42 +0000 Subject: [PATCH 024/112] Bump actions/setup-node from 4.0.2 to 4.0.3 in the actions group Bumps the actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 4.0.2 to 4.0.3 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4.0.2...v4.0.3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- .github/workflows/node.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index b4beee36..fb7139e3 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@v4.0.3 with: node-version: '16' check-version: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 39de8f65..2a0625b1 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@v4.0.3 with: node-version: '16' check-latest: true From cf682f902984eca8a1acf615001c500a5616532b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:56:30 +0000 Subject: [PATCH 025/112] Bump minitest from 5.22.3 to 5.25.0 Bumps [minitest](https://github.com/minitest/minitest) from 5.22.3 to 5.25.0. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.22.3...v5.25.0) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ab1f1c7e..c9d7998f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) - minitest (5.22.3) + minitest (5.25.0) parallel (1.24.0) parser (3.3.1.0) ast (~> 2.4.1) From cf01553469561ecedbb9ab8dae8e29bd98934ccd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:08:05 +0000 Subject: [PATCH 026/112] Bump minitest from 5.25.0 to 5.25.1 Bumps [minitest](https://github.com/minitest/minitest) from 5.25.0 to 5.25.1. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.25.0...v5.25.1) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c9d7998f..fccf8c7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) - minitest (5.25.0) + minitest (5.25.1) parallel (1.24.0) parser (3.3.1.0) ast (~> 2.4.1) From ce2e24d2322fb1d99e941baaced2d5f092d4db1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:10:52 +0000 Subject: [PATCH 027/112] Bump actions/setup-node from 4.0.3 to 4.0.4 in the actions group Bumps the actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 4.0.3 to 4.0.4 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4.0.3...v4.0.4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- .github/workflows/node.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index fb7139e3..690acf70 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.0.3 + uses: actions/setup-node@v4.0.4 with: node-version: '16' check-version: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 2a0625b1..0296588d 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.0.3 + uses: actions/setup-node@v4.0.4 with: node-version: '16' check-latest: true From f7b7cc80b6520dfc90f6a7b8f44a4f3198ceb973 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:59:35 +0000 Subject: [PATCH 028/112] Bump diffy from 3.4.2 to 3.4.3 Bumps [diffy](https://github.com/samg/diffy) from 3.4.2 to 3.4.3. - [Changelog](https://github.com/samg/diffy/blob/main/CHANGELOG) - [Commits](https://github.com/samg/diffy/commits) --- updated-dependencies: - dependency-name: diffy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fccf8c7a..8cb271d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GEM base64 (0.2.0) byebug (11.1.3) coderay (1.1.3) - diffy (3.4.2) + diffy (3.4.3) json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) From bc6433926a211c2032b909c6ac39533d6845ea86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:19:24 +0000 Subject: [PATCH 029/112] Bump minitest from 5.25.1 to 5.25.4 Bumps [minitest](https://github.com/minitest/minitest) from 5.25.1 to 5.25.4. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.25.1...v5.25.4) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fccf8c7a..cd97ded7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) - minitest (5.25.1) + minitest (5.25.4) parallel (1.24.0) parser (3.3.1.0) ast (~> 2.4.1) From 5f89557ad146069219fb6dc5d46e5183012a694a Mon Sep 17 00:00:00 2001 From: Andy Waite <13400+andyw8@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:33:29 -0500 Subject: [PATCH 030/112] Enable Lint/DuplicateCaseCondition --- rubocop.yml | 3 --- test/fixtures/full_config.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 6f6543ee..5d251157 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -129,9 +129,6 @@ Lint/DisjunctiveAssignmentInConstructor: Lint/DuplicateBranch: Enabled: false -Lint/DuplicateCaseCondition: - Enabled: false - Lint/DuplicateElsifCondition: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index fef84296..08712135 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1262,7 +1262,7 @@ Lint/DuplicateBranch: IgnoreConstantBranches: false Lint/DuplicateCaseCondition: Description: Do not repeat values in case conditionals. - Enabled: false + Enabled: true VersionAdded: '0.45' Lint/DuplicateElsifCondition: Description: Do not repeat conditions used in if `elsif`. From f590ad44c3c5cc8e5ebfd0e71c8e8fbdfbb2a903 Mon Sep 17 00:00:00 2001 From: Andy Waite <13400+andyw8@users.noreply.github.com> Date: Thu, 23 Jan 2025 17:35:46 -0500 Subject: [PATCH 031/112] Enable `AllowComments` config option for `Style/EmptyElse` --- rubocop.yml | 3 +++ test/fixtures/full_config.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 5d251157..09c5d526 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -500,6 +500,9 @@ Style/DoubleNegation: Style/EmptyBlockParameter: Enabled: false +Style/EmptyElse: + AllowComments: true + Style/EmptyHeredoc: Enabled: true diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 08712135..a4ec0cf6 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2782,7 +2782,7 @@ Style/EmptyElse: - empty - nil - both - AllowComments: false + AllowComments: true Style/EmptyHeredoc: Description: Checks for using empty heredoc to reduce redundancy. Enabled: true From da85a1de321cc8b8bc8eaefe45a0ea3e9dc413d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:28:05 +0000 Subject: [PATCH 032/112] Bump actions/setup-node in the actions group across 1 directory Bumps the actions group with 1 update in the / directory: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 4.0.4 to 4.2.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4.0.4...v4.2.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- .github/workflows/node.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 690acf70..71f5d93b 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.2.0 with: node-version: '16' check-version: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 0296588d..e330b8eb 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.2.0 with: node-version: '16' check-latest: true From bc75a7b9d99515fbea402409857515e33ed5a077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 18:10:05 +0000 Subject: [PATCH 033/112] Add devcontainer config --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .ruby-version | 2 +- Gemfile.lock | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..3245a348 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ruby +{ + "name": "Ruby Style Guide", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "ghcr.io/rails/devcontainer/images/ruby:3.4.1", + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {} + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "ruby --version", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.ruby-version b/.ruby-version index 15a27998..47b322c9 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.0 +3.4.1 diff --git a/Gemfile.lock b/Gemfile.lock index 55e64bcd..55ed782e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -59,4 +59,4 @@ DEPENDENCIES rubocop-shopify! BUNDLED WITH - 2.5.3 + 2.6.3 From ff062dc7213a6a0f4e28ae5295c85ff91f88ba3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 18:10:43 +0000 Subject: [PATCH 034/112] Remove rubocop-cli.yml config We aren't using it anymore. The main reason for it existing is that we had some rules that only made send for Rails applications. As we are resetting the rules, we don't know if we are going to need this file again. --- rubocop-cli.yml | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 rubocop-cli.yml diff --git a/rubocop-cli.yml b/rubocop-cli.yml deleted file mode 100644 index fb7babb9..00000000 --- a/rubocop-cli.yml +++ /dev/null @@ -1,44 +0,0 @@ -inherit_gem: - rubocop-shopify: - - rubocop.yml - -AllCops: - # We don't always use bundler to make for a faster boot time. - # In this case we vendor a small number of dependencies we absolutely - # require. Since they are vendored and 3rd party we do not impose our - # styleguide on them but they are still in the repo. - Exclude: - - 'vendor/**/*' - -# We disable this at entrypoint. -# Due to CLI apps being invoked via an entry point, -# we can exclude this from all files -Style/FrozenStringLiteralComment: - Enabled: false - -# This doesn't take into account retrying from an exception. E.g.: -# begin -# retries ||= 0 -# do_a_thing -# rescue => e -# retry if (retries += 1) < 3 -# handle_error(e) -# end -Lint/SuppressedException: - Enabled: false - -# Allow the use of globals which occasionally makes sense in a CLI app -# As we are not multi-threaded and have a single entry point, this makes it easy to, -# for example, track process environments to restore at the end of invocation -Style/GlobalVars: - Enabled: false - -# Allow readable block formatting in some weird cases -# Particularly in something like: -# Dev::Util.begin do -# might_raise_if_costly_prep_not_done() -# end.retry_after(ExpectedError) do -# costly_prep() -# end -Style/MultilineBlockChain: - Enabled: false From 27a8902429c80249dd32f4c5b82413a04efbbaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 20:38:26 +0000 Subject: [PATCH 035/112] Disable all cops --- rubocop.yml | 895 ++++++++++++++++++++++++++++++---- test/fixtures/full_config.yml | 654 ++++++++++++------------- 2 files changed, 1136 insertions(+), 413 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 09c5d526..21557e61 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -13,130 +13,402 @@ AllCops: StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ NewCops: disable # New cops will be triaged by style guide maintainers instead. +# Bundler Department +Bundler/DuplicatedGem: + Enabled: false + +Bundler/DuplicatedGroup: + Enabled: false + +Bundler/GemFilename: + Enabled: false + +Bundler/InsecureProtocolSource: + Enabled: false + Bundler/OrderedGems: Enabled: false + +# Gemspec Department Gemspec/DeprecatedAttributeAssignment: - Enabled: true + Enabled: false Gemspec/DevelopmentDependencies: Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false + +Gemspec/OrderedDependencies: + Enabled: false + Gemspec/RequireMFA: Enabled: false Gemspec/RequiredRubyVersion: Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false + + +# Layout Department +Layout/AccessModifierIndentation: + Enabled: false + Layout/ArgumentAlignment: + Enabled: false EnforcedStyle: with_fixed_indentation +Layout/ArrayAlignment: + Enabled: false + +Layout/AssignmentIndentation: + Enabled: false + +Layout/BeginEndAlignment: + Enabled: false + +Layout/BlockAlignment: + Enabled: false + +Layout/BlockEndNewline: + Enabled: false + Layout/CaseIndentation: + Enabled: false EnforcedStyle: end +Layout/ClosingHeredocIndentation: + Enabled: false + +Layout/ClosingParenthesisIndentation: + Enabled: false + +Layout/CommentIndentation: + Enabled: false + +Layout/ConditionPosition: + Enabled: false + +Layout/DefEndAlignment: + Enabled: false + +Layout/DotPosition: + Enabled: false + +Layout/ElseAlignment: + Enabled: false + +Layout/EmptyComment: + Enabled: false + +Layout/EmptyLineAfterGuardClause: + Enabled: false + +Layout/EmptyLineAfterMagicComment: + Enabled: false + +Layout/EmptyLineBetweenDefs: + Enabled: false + +Layout/EmptyLines: + Enabled: false + +Layout/EmptyLinesAroundAccessModifier: + Enabled: false + +Layout/EmptyLinesAroundArguments: + Enabled: false + +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false + +Layout/EmptyLinesAroundBeginBody: + Enabled: false + +Layout/EmptyLinesAroundBlockBody: + Enabled: false + +Layout/EmptyLinesAroundClassBody: + Enabled: false + +Layout/EmptyLinesAroundExceptionHandlingKeywords: + Enabled: false + +Layout/EmptyLinesAroundMethodBody: + Enabled: false + +Layout/EmptyLinesAroundModuleBody: + Enabled: false + Layout/EndAlignment: + Enabled: false EnforcedStyleAlignWith: variable +Layout/EndOfLine: + Enabled: false + +Layout/ExtraSpacing: + Enabled: false + Layout/FirstArgumentIndentation: + Enabled: false EnforcedStyle: consistent Layout/FirstArrayElementIndentation: + Enabled: false EnforcedStyle: consistent Layout/FirstArrayElementLineBreak: - Enabled: true AllowMultilineFinalElement: true Layout/FirstHashElementIndentation: + Enabled: false EnforcedStyle: consistent -Layout/FirstHashElementLineBreak: - Enabled: true - Layout/FirstMethodArgumentLineBreak: - Enabled: true AllowMultilineFinalElement: true +Layout/FirstParameterIndentation: + Enabled: false + Layout/HashAlignment: + Enabled: false EnforcedLastArgumentHashStyle: ignore_implicit +Layout/HeredocIndentation: + Enabled: false + +Layout/IndentationConsistency: + Enabled: false + +Layout/IndentationStyle: + Enabled: false + +Layout/IndentationWidth: + Enabled: false + +Layout/InitialIndentation: + Enabled: false + +Layout/LeadingCommentSpace: + Enabled: false + +Layout/LeadingEmptyLines: + Enabled: false + Layout/LineContinuationLeadingSpace: - Enabled: true + Enabled: false Layout/LineContinuationSpacing: - Enabled: true + Enabled: false Layout/LineEndStringConcatenationIndentation: - Enabled: true + Enabled: false EnforcedStyle: indented Layout/LineLength: + Enabled: false AllowedPatterns: - "\\A\\s*(remote_)?test(_\\w+)?\\s.*(do|->)(\\s|\\Z)" - "\\A\\s*def test_\\w+\\s*\\Z" +Layout/MultilineArrayBraceLayout: + Enabled: false + Layout/MultilineArrayLineBreaks: - Enabled: true AllowMultilineFinalElement: true -Layout/MultilineHashKeyLineBreaks: - Enabled: true +Layout/MultilineBlockLayout: + Enabled: false + +Layout/MultilineHashBraceLayout: + Enabled: false Layout/MultilineMethodArgumentLineBreaks: - Enabled: true AllowMultilineFinalElement: true +Layout/MultilineMethodCallBraceLayout: + Enabled: false + Layout/MultilineMethodCallIndentation: - EnforcedStyle: indented - IndentationWidth: 2 + Enabled: false + +Layout/MultilineMethodDefinitionBraceLayout: + Enabled: false Layout/MultilineOperationIndentation: + Enabled: false EnforcedStyle: indented - Layout/ParameterAlignment: + Enabled: false EnforcedStyle: with_fixed_indentation +Layout/RescueEnsureAlignment: + Enabled: false + +Layout/SpaceAfterColon: + Enabled: false + +Layout/SpaceAfterComma: + Enabled: false + +Layout/SpaceAfterMethodName: + Enabled: false + +Layout/SpaceAfterNot: + Enabled: false + +Layout/SpaceAfterSemicolon: + Enabled: false + +Layout/SpaceAroundBlockParameters: + Enabled: false + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: false + +Layout/SpaceAroundKeyword: + Enabled: false + +Layout/SpaceAroundMethodCallOperator: + Enabled: false + +Layout/SpaceAroundOperators: + Enabled: false + +Layout/SpaceBeforeBlockBraces: + Enabled: false + Layout/SpaceBeforeBrackets: - Enabled: true + Enabled: false + +Layout/SpaceBeforeComma: + Enabled: false + +Layout/SpaceBeforeComment: + Enabled: false + +Layout/SpaceBeforeFirstArg: + Enabled: false + +Layout/SpaceBeforeSemicolon: + Enabled: false + +Layout/SpaceInLambdaLiteral: + Enabled: false + +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false + +Layout/SpaceInsideArrayPercentLiteral: + Enabled: false + +Layout/SpaceInsideBlockBraces: + Enabled: false + +Layout/SpaceInsideHashLiteralBraces: + Enabled: false + +Layout/SpaceInsideParens: + Enabled: false +Layout/SpaceInsidePercentLiteralDelimiters: + Enabled: false + +Layout/SpaceInsideRangeLiteral: + Enabled: false + +Layout/SpaceInsideReferenceBrackets: + Enabled: false + +Layout/SpaceInsideStringInterpolation: + Enabled: false + +Layout/TrailingEmptyLines: + Enabled: false + +Layout/TrailingWhitespace: + Enabled: false + + +# Lint Department Lint/AmbiguousAssignment: Enabled: false Lint/AmbiguousBlockAssociation: Enabled: false +Lint/AmbiguousOperator: + Enabled: false + Lint/AmbiguousOperatorPrecedence: Enabled: false Lint/AmbiguousRange: Enabled: false +Lint/AmbiguousRegexpLiteral: + Enabled: false + +Lint/AssignmentInCondition: + Enabled: false + +Lint/BigDecimalNew: + Enabled: false + +Lint/BinaryOperatorWithIdenticalOperands: + Enabled: false + Lint/BooleanSymbol: Enabled: false +Lint/CircularArgumentReference: + Enabled: false + Lint/ConstantDefinitionInBlock: Enabled: false Lint/ConstantOverwrittenInRescue: - Enabled: true + Enabled: false + +Lint/Debugger: + Enabled: false + +Lint/DeprecatedClassMethods: + Enabled: false Lint/DeprecatedConstants: Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false + Lint/DisjunctiveAssignmentInConstructor: Enabled: false Lint/DuplicateBranch: Enabled: false +Lint/DuplicateCaseCondition: + Enabled: false + Lint/DuplicateElsifCondition: Enabled: false +Lint/DuplicateHashKey: + Enabled: false + Lint/DuplicateMagicComment: - Enabled: true + Enabled: false Lint/DuplicateMatchPattern: - Enabled: true + Enabled: false + +Lint/DuplicateMethods: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false @@ -147,6 +419,12 @@ Lint/DuplicateRequire: Lint/DuplicateRescueException: Enabled: false +Lint/EachWithObjectArgument: + Enabled: false + +Lint/ElseLayout: + Enabled: false + Lint/EmptyBlock: Enabled: false @@ -156,6 +434,9 @@ Lint/EmptyClass: Lint/EmptyConditionalBody: Enabled: false +Lint/EmptyEnsure: + Enabled: false + Lint/EmptyExpression: Enabled: false @@ -165,43 +446,82 @@ Lint/EmptyFile: Lint/EmptyInPattern: Enabled: false +Lint/EmptyInterpolation: + Enabled: false + Lint/EmptyWhen: Enabled: false +Lint/EnsureReturn: + Enabled: false + Lint/ErbNewArguments: Enabled: false +Lint/FlipFlop: + Enabled: false + Lint/FloatComparison: Enabled: false +Lint/FloatOutOfRange: + Enabled: false + +Lint/FormatParameterMismatch: + Enabled: false + Lint/HashCompareByIdentity: Enabled: false Lint/IdentityComparison: Enabled: false +Lint/ImplicitStringConcatenation: + Enabled: false + Lint/IncompatibleIoSelectWithFiberScheduler: Enabled: false +Lint/IneffectiveAccessModifier: + Enabled: false + +Lint/InheritException: + Enabled: false + Lint/InterpolationCheck: Enabled: false -<% if rubocop_version >= "1.59" %> +<% if rubocop_version >= '1.59' %> Lint/ItWithoutArgumentsInBlock: - Enabled: true + Enabled: false <% end %> Lint/LambdaWithoutLiteralBlock: Enabled: false -<% if rubocop_version >= "1.58" %> +Lint/LiteralAsCondition: + Enabled: false + +<% if rubocop_version >= '1.58' %> Lint/LiteralAssignmentInCondition: - Enabled: true + Enabled: false <% end %> -<% if rubocop_version >= "1.53" %> +Lint/LiteralInInterpolation: + Enabled: false + +Lint/Loop: + Enabled: false + +Lint/MissingCopEnableDirective: + Enabled: false + +Lint/MissingSuper: + Enabled: false + +<% if rubocop_version >= '1.53' %> Lint/MixedCaseRange: - Enabled: true + Enabled: false <% end %> Lint/MixedRegexpCaptureTypes: @@ -210,11 +530,17 @@ Lint/MixedRegexpCaptureTypes: Lint/MultipleComparison: Enabled: false +Lint/NestedMethodDefinition: + Enabled: false + Lint/NestedPercentLiteral: Enabled: false +Lint/NextWithoutAccumulator: + Enabled: false + Lint/NoReturnInBeginEndBlocks: - Enabled: true + Enabled: false Lint/NonAtomicFileOperation: Enabled: false @@ -222,24 +548,48 @@ Lint/NonAtomicFileOperation: Lint/NonDeterministicRequireOrder: Enabled: false +Lint/NonLocalExitFromIterator: + Enabled: false + Lint/NumberedParameterAssignment: Enabled: false Lint/OrAssignmentToConstant: Enabled: false +Lint/OrderedMagicComments: + Enabled: false + Lint/OutOfRangeRegexpRef: Enabled: false +Lint/ParenthesesAsGroupedExpression: + Enabled: false + +Lint/PercentStringArray: + Enabled: false + +Lint/PercentSymbolArray: + Enabled: false + Lint/RaiseException: Enabled: false +Lint/RandOne: + Enabled: false + +Lint/RedundantCopDisableDirective: + Enabled: false + +Lint/RedundantCopEnableDirective: + Enabled: false + Lint/RedundantDirGlobSort: Enabled: false -<% if rubocop_version >= "1.53" %> +<% if rubocop_version >= '1.53' %> Lint/RedundantRegexpQuantifiers: - Enabled: true + Enabled: false <% end %> Lint/RedundantRequireStatement: @@ -248,6 +598,12 @@ Lint/RedundantRequireStatement: Lint/RedundantSafeNavigation: Enabled: false +Lint/RedundantSplatExpansion: + Enabled: false + +Lint/RedundantStringCoercion: + Enabled: false + Lint/RedundantWithIndex: Enabled: false @@ -260,11 +616,17 @@ Lint/RefinementImportMethods: Lint/RegexpAsCondition: Enabled: false +Lint/RequireParentheses: + Enabled: false + Lint/RequireRangeParentheses: - Enabled: true + Enabled: false Lint/RequireRelativeSelfPath: - Enabled: true + Enabled: false + +Lint/RescueException: + Enabled: false Lint/RescueType: Enabled: false @@ -272,6 +634,9 @@ Lint/RescueType: Lint/ReturnInVoidContext: Enabled: false +Lint/SafeNavigationChain: + Enabled: false + Lint/SafeNavigationConsistency: Enabled: false @@ -290,12 +655,18 @@ Lint/SendWithMixinArgument: Lint/ShadowedArgument: Enabled: false +Lint/ShadowedException: + Enabled: false + Lint/ShadowingOuterLocalVariable: Enabled: false Lint/StructNewOverride: Enabled: false +Lint/SuppressedException: + Enabled: false + Lint/SymbolConversion: Enabled: false @@ -314,15 +685,27 @@ Lint/TrailingCommaInAttributeDeclaration: Lint/TripleQuotes: Enabled: false +Lint/UnderscorePrefixedVariableName: + Enabled: false + Lint/UnexpectedBlockArity: Enabled: false +Lint/UnifiedInteger: + Enabled: false + Lint/UnmodifiedReduceAccumulator: Enabled: false +Lint/UnreachableCode: + Enabled: false + Lint/UnreachableLoop: Enabled: false +Lint/UnusedBlockArgument: + Enabled: false + Lint/UnusedMethodArgument: Enabled: false @@ -332,52 +715,95 @@ Lint/UriEscapeUnescape: Lint/UriRegexp: Enabled: false +Lint/UselessAccessModifier: + Enabled: false + +Lint/UselessAssignment: + Enabled: false + +Lint/UselessElseWithoutRescue: + Enabled: false + Lint/UselessMethodDefinition: Enabled: false Lint/UselessRescue: - Enabled: true + Enabled: false Lint/UselessRuby2Keywords: - Enabled: true + Enabled: false + +Lint/UselessSetterCall: + Enabled: false Lint/UselessTimes: Enabled: false +Lint/Void: + Enabled: false + + +# Metrics Department Metrics/AbcSize: Enabled: false Metrics/BlockLength: Enabled: false +Metrics/BlockNesting: + Enabled: false + Metrics/ClassLength: Enabled: false Metrics/CollectionLiteralLength: - Enabled: true + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ModuleLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + CountKeywordArgs: false + +Metrics/PerceivedComplexity: + Enabled: false + + +# Migration Department +Migration/DepartmentName: + Enabled: false + -Metrics/CyclomaticComplexity: +# Naming Department +Naming/AccessorMethodName: Enabled: false -Metrics/MethodLength: +Naming/AsciiIdentifiers: Enabled: false -Metrics/ModuleLength: +Naming/BinaryOperatorParameterName: Enabled: false -Metrics/ParameterLists: - CountKeywordArgs: false +Naming/BlockForwarding: + Enabled: false -Metrics/PerceivedComplexity: +Naming/BlockParameterName: Enabled: false -Migration/DepartmentName: +Naming/ClassAndModuleCamelCase: Enabled: false -Naming/BlockForwarding: +Naming/ConstantName: Enabled: false -Naming/BlockParameterName: +Naming/FileName: Enabled: false Naming/HeredocDelimiterCase: @@ -390,6 +816,7 @@ Naming/MemoizedInstanceVariableName: Enabled: false Naming/MethodName: + Enabled: false AllowedPatterns: - '\Atest_' @@ -397,6 +824,7 @@ Naming/MethodParameterName: Enabled: false Naming/PredicateName: + Enabled: false NamePrefix: - is_ ForbiddenPrefixes: @@ -405,21 +833,37 @@ Naming/PredicateName: Naming/RescuedExceptionsVariableName: Enabled: false +Naming/VariableName: + Enabled: false + Naming/VariableNumber: Enabled: false + +# Security Department Security/CompoundHash: Enabled: false +Security/Eval: + Enabled: false + Security/IoMethods: - Enabled: true + Enabled: false + +Security/JSONLoad: + Enabled: false Security/MarshalLoad: Enabled: false +Security/Open: + Enabled: false + Security/YAMLLoad: Enabled: false + +# Style Department Style/AccessModifierDeclarations: Enabled: false @@ -427,34 +871,74 @@ Style/AccessorGrouping: Enabled: false Style/Alias: + Enabled: false EnforcedStyle: prefer_alias_method +Style/AndOr: + Enabled: false + Style/ArgumentsForwarding: Enabled: false Style/ArrayIntersect: - Enabled: true + Enabled: false + +Style/ArrayJoin: + Enabled: false + +Style/Attr: + Enabled: false + +Style/BarePercentLiterals: + Enabled: false + +Style/BeginBlock: + Enabled: false Style/BisectedAttrAccessor: Enabled: false +Style/BlockComments: + Enabled: false + +Style/BlockDelimiters: + Enabled: false + Style/CaseEquality: + Enabled: false AllowOnConstant: true AllowOnSelfClass: true Style/CaseLikeIf: Enabled: false +Style/CharacterLiteral: + Enabled: false + +Style/ClassAndModuleChildren: + Enabled: false + +Style/ClassCheck: + Enabled: false + Style/ClassEqualityComparison: Enabled: false +Style/ClassMethods: + Enabled: false + Style/ClassMethodsDefinitions: EnforcedStyle: self_class - Enabled: true + +Style/ClassVars: + Enabled: false Style/CollectionCompact: Enabled: false +Style/ColonMethodCall: + Enabled: false + Style/ColonMethodDefinition: Enabled: false @@ -462,28 +946,35 @@ Style/CombinableLoops: Enabled: false Style/CommandLiteral: + Enabled: false EnforcedStyle: percent_x +Style/CommentAnnotation: + Enabled: false + Style/CommentedKeyword: Enabled: false Style/ComparableClamp: - Enabled: true + Enabled: false Style/ConcatArrayLiterals: - Enabled: true + Enabled: false + +Style/ConditionalAssignment: + Enabled: false Style/DataInheritance: - Enabled: true + Enabled: false -Style/DateTime: - Enabled: true +Style/DefWithParentheses: + Enabled: false Style/Dir: Enabled: false Style/DirEmpty: - Enabled: true + Enabled: false Style/DocumentDynamicEvalDefinition: Enabled: false @@ -497,26 +988,42 @@ Style/DoubleCopDisableDirective: Style/DoubleNegation: Enabled: false +Style/EachForSimpleLoop: + Enabled: false + +Style/EachWithObject: + Enabled: false + Style/EmptyBlockParameter: Enabled: false +Style/EmptyCaseCondition: + Enabled: false + Style/EmptyElse: + Enabled: false AllowComments: true Style/EmptyHeredoc: - Enabled: true + Enabled: false Style/EmptyLambdaParameter: Enabled: false +Style/EmptyLiteral: + Enabled: false + Style/EmptyMethod: Enabled: false Style/Encoding: Enabled: false +Style/EndBlock: + Enabled: false + Style/EndlessMethod: - Enabled: true + Enabled: false Style/EnvHome: Enabled: false @@ -524,12 +1031,18 @@ Style/EnvHome: Style/EvalWithLocation: Enabled: false +Style/EvenOdd: + Enabled: false + Style/ExactRegexpMatch: - Enabled: true + Enabled: false Style/ExpandPathArguments: Enabled: false +Style/ExplicitBlockArgument: + Enabled: false + Style/ExponentialNotation: Enabled: false @@ -537,7 +1050,7 @@ Style/FetchEnvVar: Enabled: false Style/FileEmpty: - Enabled: true + Enabled: false Style/FileRead: Enabled: false @@ -548,16 +1061,29 @@ Style/FileWrite: Style/FloatDivision: Enabled: false +Style/For: + Enabled: false + +Style/FormatString: + Enabled: false + Style/FormatStringToken: Enabled: false Style/FrozenStringLiteralComment: + Enabled: false SafeAutoCorrect: true EnforcedStyle: always_true Details: 'Add `# frozen_string_literal: true` to the top of the file. Frozen string literals will become the default in a future Ruby version, and we want to make sure we''re ready.' +Style/GlobalStdStream: + Enabled: false + +Style/GlobalVars: + Enabled: false + Style/GuardClause: Enabled: false @@ -577,6 +1103,7 @@ Style/HashLikeCase: Enabled: false Style/HashSyntax: + Enabled: false EnforcedShorthandSyntax: either Style/HashTransformKeys: @@ -585,20 +1112,32 @@ Style/HashTransformKeys: Style/HashTransformValues: Enabled: false +Style/IdenticalConditionalBranches: + Enabled: false + +Style/IfInsideElse: + Enabled: false + Style/IfUnlessModifier: Enabled: false +Style/IfUnlessModifierOfIfUnless: + Enabled: false + Style/IfWithBooleanLiteralBranches: - Enabled: true + Enabled: false + +Style/IfWithSemicolon: + Enabled: false Style/InPatternThen: - Enabled: true + Enabled: false -Style/InverseMethods: +Style/InfiniteLoop: Enabled: false -Style/InvertibleUnlessCondition: - Enabled: true +Style/InverseMethods: + Enabled: false Style/KeywordParametersOrder: Enabled: false @@ -606,8 +1145,14 @@ Style/KeywordParametersOrder: Style/Lambda: Enabled: false +Style/LambdaCall: + Enabled: false + +Style/LineEndConcatenation: + Enabled: false + Style/MagicCommentFormat: - Enabled: true + Enabled: false ValueCapitalization: lowercase Style/MapCompactWithConditionalBlock: @@ -625,7 +1170,6 @@ Style/MapToSet: Enabled: false Style/MethodCallWithArgsParentheses: - Enabled: true AllowedMethods: - require - require_relative @@ -636,16 +1180,29 @@ Style/MethodCallWithArgsParentheses: Exclude: - "/**/Gemfile" +Style/MethodCallWithoutArgsParentheses: + Enabled: false + +Style/MethodDefParentheses: + Enabled: false + Style/MinMax: Enabled: false Style/MinMaxComparison: - Enabled: true + Enabled: false + +Style/MissingRespondToMissing: + Enabled: false Style/MixinGrouping: Enabled: false +Style/MixinUsage: + Enabled: false + Style/ModuleFunction: + Enabled: false EnforcedStyle: extend_self Style/MultilineBlockChain: @@ -654,9 +1211,18 @@ Style/MultilineBlockChain: Style/MultilineIfModifier: Enabled: false +Style/MultilineIfThen: + Enabled: false + Style/MultilineInPatternThen: Enabled: false +Style/MultilineMemoization: + Enabled: false + +Style/MultilineTernaryOperator: + Enabled: false + Style/MultilineWhenThen: Enabled: false @@ -666,24 +1232,54 @@ Style/MultipleComparison: Style/MutableConstant: Enabled: false +Style/NegatedIf: + Enabled: false + Style/NegatedIfElseCondition: Enabled: false Style/NegatedUnless: Enabled: false +Style/NegatedWhile: + Enabled: false + Style/NestedFileDirname: - Enabled: true + Enabled: false + +Style/NestedModifier: + Enabled: false + +Style/NestedParenthesizedCalls: + Enabled: false + +Style/NestedTernaryOperator: + Enabled: false + +Style/Next: + Enabled: false + +Style/NilComparison: + Enabled: false Style/NilLambda: Enabled: false +Style/NonNilCheck: + Enabled: false + +Style/Not: + Enabled: false + Style/NumberedParameters: Enabled: false Style/NumberedParametersLimit: Enabled: false +Style/NumericLiteralPrefix: + Enabled: false + Style/NumericLiterals: Enabled: false @@ -693,11 +1289,17 @@ Style/NumericPredicate: Style/ObjectThen: Enabled: false +Style/OneLineConditional: + Enabled: false + Style/OpenStructUse: - Enabled: true + Enabled: false Style/OperatorMethodCall: - Enabled: true + Enabled: false + +Style/OptionalArguments: + Enabled: false Style/OptionalBooleanParameter: Enabled: false @@ -705,12 +1307,32 @@ Style/OptionalBooleanParameter: Style/OrAssignment: Enabled: false +Style/ParallelAssignment: + Enabled: false + +Style/ParenthesesAroundCondition: + Enabled: false + Style/PercentLiteralDelimiters: Enabled: false +Style/PercentQLiterals: + Enabled: false + +Style/PerlBackrefs: + Enabled: false + +Style/PreferredHashMethods: + Enabled: false + +Style/Proc: + Enabled: false + Style/QuotedSymbols: - Enabled: true + Enabled: false +Style/RaiseArgs: + Enabled: false Style/RandomWithOffset: Enabled: false @@ -719,12 +1341,18 @@ Style/RedundantArgument: <% if rubocop_version >= "1.52" %> Style/RedundantArrayConstructor: - Enabled: true + Enabled: false <% end %> Style/RedundantAssignment: Enabled: false +Style/RedundantBegin: + Enabled: false + +Style/RedundantCapitalW: + Enabled: false + Style/RedundantCondition: Enabled: false @@ -732,18 +1360,21 @@ Style/RedundantConditional: Enabled: false Style/RedundantConstantBase: - Enabled: true + Enabled: false <% if rubocop_version >= "1.53" %> Style/RedundantCurrentDirectoryInPath: - Enabled: true + Enabled: false <% end %> Style/RedundantDoubleSplatHashBraces: - Enabled: true + Enabled: false Style/RedundantEach: - Enabled: true + Enabled: false + +Style/RedundantException: + Enabled: false Style/RedundantFetchBlock: Enabled: false @@ -753,21 +1384,33 @@ Style/RedundantFileExtensionInRequire: <% if rubocop_version >= "1.52" %> Style/RedundantFilterChain: - Enabled: true + Enabled: false <% end %> +Style/RedundantFreeze: + Enabled: false + Style/RedundantHeredocDelimiterQuotes: - Enabled: true + Enabled: false Style/RedundantInitialize: Enabled: false +Style/RedundantInterpolation: + Enabled: false + Style/RedundantLineContinuation: - Enabled: true + Enabled: false <% if rubocop_version >= "1.53" %> +Style/RedundantParentheses: + Enabled: false + +Style/RedundantPercentQ: + Enabled: false + Style/RedundantRegexpArgument: - Enabled: true + Enabled: false <% end %> Style/RedundantRegexpCharacterClass: @@ -775,12 +1418,18 @@ Style/RedundantRegexpCharacterClass: <% if rubocop_version >= "1.52" %> Style/RedundantRegexpConstructor: - Enabled: true + Enabled: false <% end %> Style/RedundantRegexpEscape: Enabled: false +Style/RedundantReturn: + Enabled: false + +Style/RedundantSelf: + Enabled: false + Style/RedundantSelfAssignment: Enabled: false @@ -790,40 +1439,68 @@ Style/RedundantSelfAssignmentBranch: Style/RedundantSort: Enabled: false +Style/RedundantSortBy: + Enabled: false + Style/RedundantStringEscape: - Enabled: true + Enabled: false Style/RegexpLiteral: + Enabled: false EnforcedStyle: mixed -Style/RescueStandardError: +Style/RescueModifier: Enabled: false -Style/ReturnNil: - Enabled: true +Style/RescueStandardError: + Enabled: false <% if rubocop_version >= "1.53" %> Style/ReturnNilInPredicateMethodDefinition: - Enabled: true + Enabled: false <% end %> +Style/SafeNavigation: + Enabled: false + +Style/Sample: + Enabled: false + Style/SelectByRegexp: Enabled: false +Style/SelfAssignment: + Enabled: false + +Style/Semicolon: + Enabled: false + +Style/SignalException: + Enabled: false + Style/SingleArgumentDig: Enabled: false <% if rubocop_version >= "1.57" %> Style/SingleLineDoEndBlock: - Enabled: true + Enabled: false <% end %> +Style/SingleLineMethods: + Enabled: false + Style/SlicingWithRange: Enabled: false Style/SoleNestedConditional: Enabled: false +Style/SpecialGlobalVars: + Enabled: false + +Style/StabbyLambdaParentheses: + Enabled: false + Style/StderrPuts: Enabled: false @@ -834,35 +1511,59 @@ Style/StringConcatenation: Enabled: false Style/StringLiterals: + Enabled: false EnforcedStyle: double_quotes Style/StringLiteralsInInterpolation: + Enabled: false EnforcedStyle: double_quotes +Style/Strip: + Enabled: false + Style/StructInheritance: Enabled: false <% if rubocop_version >= "1.58" %> Style/SuperWithArgsParentheses: - Enabled: true + Enabled: false <% end %> Style/SwapValues: Enabled: false Style/SymbolArray: + Enabled: false EnforcedStyle: brackets +Style/SymbolLiteral: + Enabled: false + +Style/SymbolProc: + Enabled: false + +Style/TernaryParentheses: + Enabled: false + +Style/TrailingBodyOnClass: + Enabled: false + Style/TrailingBodyOnMethodDefinition: Enabled: false +Style/TrailingBodyOnModule: + Enabled: false + Style/TrailingCommaInArguments: + Enabled: false EnforcedStyleForMultiline: comma Style/TrailingCommaInArrayLiteral: + Enabled: false EnforcedStyleForMultiline: consistent_comma Style/TrailingCommaInHashLiteral: + Enabled: false EnforcedStyleForMultiline: consistent_comma Style/TrailingMethodEndStatement: @@ -871,16 +1572,38 @@ Style/TrailingMethodEndStatement: Style/TrailingUnderscoreVariable: Enabled: false +Style/TrivialAccessors: + Enabled: false + +Style/UnlessElse: + Enabled: false + Style/UnpackFirst: Enabled: false +Style/VariableInterpolation: + Enabled: false + +Style/WhenThen: + Enabled: false + +Style/WhileUntilDo: + Enabled: false + +Style/WhileUntilModifier: + Enabled: false + Style/WordArray: + Enabled: false EnforcedStyle: brackets <% if rubocop_version >= "1.53" %> Style/YAMLFileRead: - Enabled: true + Enabled: false <% end %> Style/YodaCondition: Enabled: false + +Style/ZeroLengthPredicate: + Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index a4ec0cf6..efbecf1f 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -104,7 +104,7 @@ AllCops: ActiveSupportExtensionsEnabled: false Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. - Enabled: true + Enabled: false Severity: warning VersionAdded: '0.46' VersionChanged: '1.40' @@ -114,7 +114,7 @@ Bundler/DuplicatedGem: - "**/gems.rb" Bundler/DuplicatedGroup: Description: Checks for duplicate group entries in Gemfile. - Enabled: true + Enabled: false Severity: warning VersionAdded: '1.56' Include: @@ -134,7 +134,7 @@ Bundler/GemComment: OnlyFor: [] Bundler/GemFilename: Description: Enforces the filename for managing gems. - Enabled: true + Enabled: false VersionAdded: '1.20' EnforcedStyle: Gemfile SupportedStyles: @@ -162,7 +162,7 @@ Bundler/InsecureProtocolSource: Description: The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated because HTTP requests are insecure. Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not. - Enabled: true + Enabled: false Severity: warning VersionAdded: '0.50' VersionChanged: '1.40' @@ -196,7 +196,7 @@ Gemspec/DependencyVersion: Gemspec/DeprecatedAttributeAssignment: Description: Checks that deprecated attribute assignments are not set in a gemspec file. - Enabled: true + Enabled: false Severity: warning VersionAdded: '1.30' VersionChanged: '1.40' @@ -220,7 +220,7 @@ Gemspec/DevelopmentDependencies: Gemspec/DuplicatedAssignment: Description: An attribute assignment method calls should be listed only once in a gemspec. - Enabled: true + Enabled: false Severity: warning VersionAdded: '0.52' VersionChanged: '1.40' @@ -228,7 +228,7 @@ Gemspec/DuplicatedAssignment: - "**/*.gemspec" Gemspec/OrderedDependencies: Description: Dependencies in the gemspec should be alphabetically sorted. - Enabled: true + Enabled: false VersionAdded: '0.51' TreatCommentsAsGroupSeparators: true ConsiderPunctuation: false @@ -257,7 +257,7 @@ Gemspec/RequiredRubyVersion: Gemspec/RubyVersionGlobalsUsage: Description: Checks usage of RUBY_VERSION in gemspec. StyleGuide: "#no-ruby-version-in-the-gemspec" - Enabled: true + Enabled: false Severity: warning VersionAdded: '0.72' VersionChanged: '1.40' @@ -266,7 +266,7 @@ Gemspec/RubyVersionGlobalsUsage: Layout/AccessModifierIndentation: Description: Check indentation of private/protected visibility modifiers. StyleGuide: "#indent-public-private-protected" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: indent SupportedStyles: @@ -276,7 +276,7 @@ Layout/AccessModifierIndentation: Layout/ArgumentAlignment: Description: Align the arguments of a method call if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: with_fixed_indentation @@ -287,7 +287,7 @@ Layout/ArgumentAlignment: Layout/ArrayAlignment: Description: Align the elements of an array literal if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: with_first_element @@ -298,13 +298,13 @@ Layout/ArrayAlignment: Layout/AssignmentIndentation: Description: Checks the indentation of the first line of the right-hand-side of a multi-line assignment. - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.45' IndentationWidth: Layout/BeginEndAlignment: Description: Align ends corresponding to begins correctly. - Enabled: true + Enabled: false VersionAdded: '0.91' EnforcedStyleAlignWith: start_of_line SupportedStylesAlignWith: @@ -313,7 +313,7 @@ Layout/BeginEndAlignment: Severity: warning Layout/BlockAlignment: Description: Align block ends correctly. - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleAlignWith: either SupportedStylesAlignWith: @@ -322,12 +322,12 @@ Layout/BlockAlignment: - start_of_line Layout/BlockEndNewline: Description: Put end statement of multiline block on its own line. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/CaseIndentation: Description: Indentation of when in a case/(when|in)/[else/]end. StyleGuide: "#indent-when-to-case" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.16' EnforcedStyle: end @@ -358,15 +358,15 @@ Layout/ClassStructure: - private_methods Layout/ClosingHeredocIndentation: Description: Checks the indentation of here document closings. - Enabled: true + Enabled: false VersionAdded: '0.57' Layout/ClosingParenthesisIndentation: Description: Checks the indentation of hanging closing parentheses. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/CommentIndentation: Description: Indentation of comments. - Enabled: true + Enabled: false AllowForAlignment: false VersionAdded: '0.49' VersionChanged: '1.24' @@ -374,12 +374,12 @@ Layout/ConditionPosition: Description: Checks for condition placed in a confusing position relative to the keyword. StyleGuide: "#same-line-condition" - Enabled: true + Enabled: false VersionAdded: '0.53' VersionChanged: '0.83' Layout/DefEndAlignment: Description: Align ends corresponding to defs correctly. - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleAlignWith: start_of_line SupportedStylesAlignWith: @@ -389,7 +389,7 @@ Layout/DefEndAlignment: Layout/DotPosition: Description: Checks the position of the dot in multi-line method calls. StyleGuide: "#consistent-multi-line-chains" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: leading SupportedStyles: @@ -397,11 +397,11 @@ Layout/DotPosition: - trailing Layout/ElseAlignment: Description: Align elses and elsifs correctly. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyComment: Description: Checks empty comment. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.53' VersionChanged: '1.61' @@ -409,13 +409,13 @@ Layout/EmptyComment: AllowMarginComment: true Layout/EmptyLineAfterGuardClause: Description: Add empty line after guard clause. - Enabled: true + Enabled: false VersionAdded: '0.56' VersionChanged: '0.59' Layout/EmptyLineAfterMagicComment: Description: Add an empty line after magic comments to separate them from code. StyleGuide: "#separate-magic-comments-from-code" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLineAfterMultilineCondition: Description: Enforces empty line after multiline condition. @@ -426,7 +426,7 @@ Layout/EmptyLineAfterMultilineCondition: Layout/EmptyLineBetweenDefs: Description: Use empty lines between class/module/method defs. StyleGuide: "#empty-lines-between-methods" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.23' EmptyLineBetweenMethodDefs: true @@ -438,12 +438,12 @@ Layout/EmptyLineBetweenDefs: Layout/EmptyLines: Description: Don't use several empty lines in a row. StyleGuide: "#two-or-more-empty-lines" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundAccessModifier: Description: Keep blank lines around access modifiers. StyleGuide: "#empty-lines-around-access-modifier" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: around SupportedStyles: @@ -453,12 +453,12 @@ Layout/EmptyLinesAroundAccessModifier: - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions Layout/EmptyLinesAroundArguments: Description: Keeps track of empty lines around method arguments. - Enabled: true + Enabled: false VersionAdded: '0.52' Layout/EmptyLinesAroundAttributeAccessor: Description: Keep blank lines around attribute accessors. StyleGuide: "#empty-lines-around-attribute-accessor" - Enabled: true + Enabled: false VersionAdded: '0.83' VersionChanged: '0.84' AllowAliasSyntax: true @@ -470,12 +470,12 @@ Layout/EmptyLinesAroundAttributeAccessor: Layout/EmptyLinesAroundBeginBody: Description: Keeps track of empty lines around begin-end bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundBlockBody: Description: Keeps track of empty lines around block bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: no_empty_lines SupportedStyles: @@ -484,7 +484,7 @@ Layout/EmptyLinesAroundBlockBody: Layout/EmptyLinesAroundClassBody: Description: Keeps track of empty lines around class bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.53' EnforcedStyle: no_empty_lines @@ -498,17 +498,17 @@ Layout/EmptyLinesAroundClassBody: Layout/EmptyLinesAroundExceptionHandlingKeywords: Description: Keeps track of empty lines around exception handling keywords. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundMethodBody: Description: Keeps track of empty lines around method bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundModuleBody: Description: Keeps track of empty lines around module bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: no_empty_lines SupportedStyles: @@ -518,7 +518,7 @@ Layout/EmptyLinesAroundModuleBody: - no_empty_lines Layout/EndAlignment: Description: Align ends correctly. - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleAlignWith: variable SupportedStylesAlignWith: @@ -529,7 +529,7 @@ Layout/EndAlignment: Layout/EndOfLine: Description: Use Unix-style line endings. StyleGuide: "#crlf" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: native SupportedStyles: @@ -538,14 +538,14 @@ Layout/EndOfLine: - crlf Layout/ExtraSpacing: Description: Do not use unnecessary spacing. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowForAlignment: true AllowBeforeTrailingComments: false ForceEqualSignAlignment: false Layout/FirstArgumentIndentation: Description: Checks the indentation of the first argument in a method call. - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: consistent @@ -557,7 +557,7 @@ Layout/FirstArgumentIndentation: IndentationWidth: Layout/FirstArrayElementIndentation: Description: Checks the indentation of the first element in an array literal. - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: consistent @@ -568,12 +568,12 @@ Layout/FirstArrayElementIndentation: IndentationWidth: Layout/FirstArrayElementLineBreak: Description: Checks for a line break before the first element in a multi-line array. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: true Layout/FirstHashElementIndentation: Description: Checks the indentation of the first key in a hash literal. - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: consistent @@ -584,13 +584,13 @@ Layout/FirstHashElementIndentation: IndentationWidth: Layout/FirstHashElementLineBreak: Description: Checks for a line break before the first element in a multi-line hash. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: false Layout/FirstMethodArgumentLineBreak: Description: Checks for a line break before the first argument in a multi-line method call. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: true Layout/FirstMethodParameterLineBreak: @@ -601,7 +601,7 @@ Layout/FirstMethodParameterLineBreak: AllowMultilineFinalElement: false Layout/FirstParameterIndentation: Description: Checks the indentation of the first parameter in a method definition. - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: consistent @@ -611,7 +611,7 @@ Layout/FirstParameterIndentation: IndentationWidth: Layout/HashAlignment: Description: Align the elements of a hash literal if they span more than one line. - Enabled: true + Enabled: false AllowMultipleStyles: true VersionAdded: '0.49' VersionChanged: '1.16' @@ -640,13 +640,13 @@ Layout/HeredocArgumentClosingParenthesis: Layout/HeredocIndentation: Description: Checks the indentation of the here document bodies. StyleGuide: "#squiggly-heredocs" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.85' Layout/IndentationConsistency: Description: Keep indentation straight. StyleGuide: "#spaces-indentation" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: normal SupportedStyles: @@ -657,7 +657,7 @@ Layout/IndentationConsistency: Layout/IndentationStyle: Description: Consistent indentation either with tabs only or spaces only. StyleGuide: "#spaces-indentation" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.82' IndentationWidth: @@ -668,32 +668,32 @@ Layout/IndentationStyle: Layout/IndentationWidth: Description: Use 2 spaces for indentation. StyleGuide: "#spaces-indentation" - Enabled: true + Enabled: false VersionAdded: '0.49' Width: 2 AllowedPatterns: [] Layout/InitialIndentation: Description: Checks the indentation of the first non-blank non-comment line in a file. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/LeadingCommentSpace: Description: Comments should start with a space. StyleGuide: "#hash-space" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.73' AllowDoxygenCommentStyle: false AllowGemfileRubyComment: false Layout/LeadingEmptyLines: Description: Check for unnecessary blank lines at the beginning of a file. - Enabled: true + Enabled: false VersionAdded: '0.57' VersionChanged: '0.77' Layout/LineContinuationLeadingSpace: Description: Use trailing spaces instead of leading spaces in strings broken over multiple lines (by a backslash). - Enabled: true + Enabled: false VersionAdded: '1.31' VersionChanged: '1.45' EnforcedStyle: trailing @@ -702,7 +702,7 @@ Layout/LineContinuationLeadingSpace: - trailing Layout/LineContinuationSpacing: Description: Checks the spacing in front of backslash in line continuations. - Enabled: true + Enabled: false VersionAdded: '1.31' EnforcedStyle: space SupportedStyles: @@ -711,7 +711,7 @@ Layout/LineContinuationSpacing: Layout/LineEndStringConcatenationIndentation: Description: Checks the indentation of the next line after a line that ends with a string literal and a backslash. - Enabled: true + Enabled: false VersionAdded: '1.18' EnforcedStyle: indented SupportedStyles: @@ -721,7 +721,7 @@ Layout/LineEndStringConcatenationIndentation: Layout/LineLength: Description: Checks that line length does not exceed the configured limit. StyleGuide: "#max-line-length" - Enabled: true + Enabled: false VersionAdded: '0.25' VersionChanged: '1.4' Max: 120 @@ -737,7 +737,7 @@ Layout/LineLength: Layout/MultilineArrayBraceLayout: Description: Checks that the closing brace in an array literal is either on the same line as the last array element, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -747,7 +747,7 @@ Layout/MultilineArrayBraceLayout: Layout/MultilineArrayLineBreaks: Description: Checks that each item in a multi-line array literal starts on a separate line. - Enabled: true + Enabled: false VersionAdded: '0.67' AllowMultilineFinalElement: true Layout/MultilineAssignmentLayout: @@ -768,12 +768,12 @@ Layout/MultilineAssignmentLayout: - new_line Layout/MultilineBlockLayout: Description: Ensures newlines after multiline block do statements. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/MultilineHashBraceLayout: Description: Checks that the closing brace in a hash literal is either on the same line as the last hash element, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -783,19 +783,19 @@ Layout/MultilineHashBraceLayout: Layout/MultilineHashKeyLineBreaks: Description: Checks that each item in a multi-line hash literal starts on a separate line. - Enabled: true + Enabled: false VersionAdded: '0.67' AllowMultilineFinalElement: false Layout/MultilineMethodArgumentLineBreaks: Description: Checks that each argument in a multi-line method call starts on a separate line. - Enabled: true + Enabled: false VersionAdded: '0.67' AllowMultilineFinalElement: true Layout/MultilineMethodCallBraceLayout: Description: Checks that the closing brace in a method call is either on the same line as the last method argument, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -805,18 +805,18 @@ Layout/MultilineMethodCallBraceLayout: Layout/MultilineMethodCallIndentation: Description: Checks indentation of method calls with the dot operator that span more than one line. - Enabled: true + Enabled: false VersionAdded: '0.49' - EnforcedStyle: indented + EnforcedStyle: aligned SupportedStyles: - aligned - indented - indented_relative_to_receiver - IndentationWidth: 2 + IndentationWidth: Layout/MultilineMethodDefinitionBraceLayout: Description: Checks that the closing brace in a method definition is either on the same line as the last method parameter, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -831,7 +831,7 @@ Layout/MultilineMethodParameterLineBreaks: AllowMultilineFinalElement: false Layout/MultilineOperationIndentation: Description: Checks indentation of binary operations that span more than one line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: indented SupportedStyles: @@ -842,7 +842,7 @@ Layout/ParameterAlignment: Description: Align the parameters of a method definition if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: with_fixed_indentation @@ -858,7 +858,7 @@ Layout/RedundantLineBreak: VersionAdded: '1.13' Layout/RescueEnsureAlignment: Description: Align rescues and ensures correctly. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SingleLineBlockChain: Description: Put method call on a separate line if chained to a single line block. @@ -867,32 +867,32 @@ Layout/SingleLineBlockChain: Layout/SpaceAfterColon: Description: Use spaces after colons. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterComma: Description: Use spaces after commas. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterMethodName: Description: Do not put a space between a method name and the opening parenthesis in a method definition. StyleGuide: "#parens-no-spaces" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterNot: Description: Tracks redundant space after the ! operator. StyleGuide: "#no-space-bang" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterSemicolon: Description: Use spaces after semicolons. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAroundBlockParameters: Description: Checks the spacing inside and after block parameters pipes. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyleInsidePipes: no_space SupportedStylesInsidePipes: @@ -902,7 +902,7 @@ Layout/SpaceAroundEqualsInParameterDefault: Description: Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration. StyleGuide: "#spaces-around-equals" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -910,16 +910,16 @@ Layout/SpaceAroundEqualsInParameterDefault: - no_space Layout/SpaceAroundKeyword: Description: Use a space around keywords if appropriate. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAroundMethodCallOperator: Description: Checks method call operators to not have spaces around them. - Enabled: true + Enabled: false VersionAdded: '0.82' Layout/SpaceAroundOperators: Description: Use a single space around operators. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' AllowForAlignment: true EnforcedStyleForExponentOperator: no_space @@ -932,7 +932,7 @@ Layout/SpaceAroundOperators: - no_space Layout/SpaceBeforeBlockBraces: Description: Checks that the left block brace has or doesn't have space before it. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -946,29 +946,29 @@ Layout/SpaceBeforeBlockBraces: Layout/SpaceBeforeBrackets: Description: Checks for receiver with a space before the opening brackets. StyleGuide: "#space-in-brackets-access" - Enabled: true + Enabled: false VersionAdded: '1.7' Layout/SpaceBeforeComma: Description: No spaces before commas. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceBeforeComment: Description: Checks for missing space between code and a comment on the same line. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceBeforeFirstArg: Description: Checks that exactly one space is used between a method name and the first argument for method calls without parentheses. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowForAlignment: true Layout/SpaceBeforeSemicolon: Description: No spaces before semicolons. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInLambdaLiteral: Description: Checks for spaces in lambda literals. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: require_no_space SupportedStyles: @@ -976,7 +976,7 @@ Layout/SpaceInLambdaLiteral: - require_space Layout/SpaceInsideArrayLiteralBrackets: Description: Checks the spacing inside array literal brackets. - Enabled: true + Enabled: false VersionAdded: '0.52' EnforcedStyle: no_space SupportedStyles: @@ -989,13 +989,13 @@ Layout/SpaceInsideArrayLiteralBrackets: - no_space Layout/SpaceInsideArrayPercentLiteral: Description: No unnecessary additional spaces between elements in %i/%w literals. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInsideBlockBraces: Description: Checks that block braces have or don't have surrounding space. For blocks taking parameters, checks that the left brace has or doesn't have trailing space. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -1009,7 +1009,7 @@ Layout/SpaceInsideBlockBraces: Layout/SpaceInsideHashLiteralBraces: Description: Use spaces inside hash literal braces - or don't. StyleGuide: "#spaces-braces" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -1023,7 +1023,7 @@ Layout/SpaceInsideHashLiteralBraces: Layout/SpaceInsideParens: Description: No spaces after ( or before ). StyleGuide: "#spaces-braces" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.22' EnforcedStyle: no_space @@ -1033,16 +1033,16 @@ Layout/SpaceInsideParens: - no_space Layout/SpaceInsidePercentLiteralDelimiters: Description: No unnecessary spaces inside delimiters of %i/%w/%x literals. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInsideRangeLiteral: Description: No spaces inside range literals. StyleGuide: "#no-space-inside-range-literals" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInsideReferenceBrackets: Description: Checks the spacing inside referential brackets. - Enabled: true + Enabled: false VersionAdded: '0.52' VersionChanged: '0.53' EnforcedStyle: no_space @@ -1056,7 +1056,7 @@ Layout/SpaceInsideReferenceBrackets: Layout/SpaceInsideStringInterpolation: Description: Checks for padding/surrounding spaces inside string interpolation. StyleGuide: "#string-interpolation" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: no_space SupportedStyles: @@ -1065,7 +1065,7 @@ Layout/SpaceInsideStringInterpolation: Layout/TrailingEmptyLines: Description: Checks trailing blank lines and final newline. StyleGuide: "#newline-eof" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: final_newline @@ -1075,7 +1075,7 @@ Layout/TrailingEmptyLines: Layout/TrailingWhitespace: Description: Avoid trailing whitespace. StyleGuide: "#no-trailing-whitespace" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.0' AllowInHeredoc: false @@ -1095,7 +1095,7 @@ Lint/AmbiguousOperator: Description: Checks for ambiguous operators in the first argument of a method invocation without parentheses. StyleGuide: "#method-invocation-parens" - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '0.83' Lint/AmbiguousOperatorPrecedence: @@ -1112,24 +1112,24 @@ Lint/AmbiguousRange: Lint/AmbiguousRegexpLiteral: Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses. - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '0.83' Lint/AssignmentInCondition: Description: Don't use assignment in conditions. StyleGuide: "#safe-assignment-in-condition" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.9' VersionChanged: '1.45' AllowSafeAssignment: true Lint/BigDecimalNew: Description: "`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead." - Enabled: true + Enabled: false VersionAdded: '0.53' Lint/BinaryOperatorWithIdenticalOperands: Description: Checks for places where binary operator has identical operands. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.89' VersionChanged: '1.7' @@ -1142,7 +1142,7 @@ Lint/BooleanSymbol: Lint/CircularArgumentReference: Description: Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument. - Enabled: true + Enabled: false VersionAdded: '0.33' Lint/ConstantDefinitionInBlock: Description: Do not define constants within a block. @@ -1155,7 +1155,7 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Description: Checks for overwriting an exception with an exception result by use `rescue =>`. - Enabled: true + Enabled: false VersionAdded: '1.31' Lint/ConstantResolution: Description: Check that constants are fully qualified with `::`. @@ -1165,7 +1165,7 @@ Lint/ConstantResolution: Ignore: [] Lint/Debugger: Description: Check for debugger calls. - Enabled: true + Enabled: false VersionAdded: '0.14' VersionChanged: '1.63' DebuggerMethods: @@ -1213,7 +1213,7 @@ Lint/Debugger: - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. - Enabled: true + Enabled: false VersionAdded: '0.19' Lint/DeprecatedConstants: Description: Checks for deprecated constants. @@ -1244,7 +1244,7 @@ Lint/DeprecatedConstants: DeprecatedVersion: '3.0' Lint/DeprecatedOpenSSLConstant: Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`. - Enabled: true + Enabled: false VersionAdded: '0.84' Lint/DisjunctiveAssignmentInConstructor: Description: In constructor, plain assignment is preferred over disjunctive. @@ -1262,7 +1262,7 @@ Lint/DuplicateBranch: IgnoreConstantBranches: false Lint/DuplicateCaseCondition: Description: Do not repeat values in case conditionals. - Enabled: true + Enabled: false VersionAdded: '0.45' Lint/DuplicateElsifCondition: Description: Do not repeat conditions used in if `elsif`. @@ -1270,20 +1270,20 @@ Lint/DuplicateElsifCondition: VersionAdded: '0.88' Lint/DuplicateHashKey: Description: Check for duplicate keys in hash literals. - Enabled: true + Enabled: false VersionAdded: '0.34' VersionChanged: '0.77' Lint/DuplicateMagicComment: Description: Check for duplicated magic comments. - Enabled: true + Enabled: false VersionAdded: '1.37' Lint/DuplicateMatchPattern: Description: Do not repeat patterns in `in` keywords. - Enabled: true + Enabled: false VersionAdded: '1.50' Lint/DuplicateMethods: Description: Check for duplicate method definitions. - Enabled: true + Enabled: false VersionAdded: '0.29' Lint/DuplicateRegexpCharacterClassElement: Description: Checks for duplicate elements in Regexp character classes. @@ -1301,11 +1301,11 @@ Lint/DuplicateRescueException: VersionAdded: '0.89' Lint/EachWithObjectArgument: Description: Check for immutable argument given to each_with_object. - Enabled: true + Enabled: false VersionAdded: '0.31' Lint/ElseLayout: Description: Check for odd code arrangement in an else block. - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '1.2' Lint/EmptyBlock: @@ -1331,7 +1331,7 @@ Lint/EmptyConditionalBody: VersionChanged: '1.61' Lint/EmptyEnsure: Description: Checks for empty ensure block. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.10' VersionChanged: '1.61' @@ -1351,7 +1351,7 @@ Lint/EmptyInPattern: VersionAdded: '1.16' Lint/EmptyInterpolation: Description: Checks for empty string interpolation. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.20' VersionChanged: '1.61' @@ -1364,7 +1364,7 @@ Lint/EmptyWhen: Lint/EnsureReturn: Description: Do not use return in an ensure block. StyleGuide: "#no-return-ensure" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.83' Lint/ErbNewArguments: @@ -1374,7 +1374,7 @@ Lint/ErbNewArguments: Lint/FlipFlop: Description: Checks for flip-flops. StyleGuide: "#no-flip-flops" - Enabled: true + Enabled: false VersionAdded: '0.16' Lint/FloatComparison: Description: Checks for the presence of precise comparison of floating point numbers. @@ -1383,11 +1383,11 @@ Lint/FloatComparison: VersionAdded: '0.89' Lint/FloatOutOfRange: Description: Catches floating-point literals too large or small for Ruby to represent. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/FormatParameterMismatch: Description: The number of parameters to format/sprint must match the fields. - Enabled: true + Enabled: false VersionAdded: '0.33' Lint/HashCompareByIdentity: Description: Prefer using `Hash#compare_by_identity` than using `object_id` for @@ -1410,7 +1410,7 @@ Lint/IdentityComparison: Lint/ImplicitStringConcatenation: Description: Checks for adjacent string literals on the same line, which could better be represented as a single string literal. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/IncompatibleIoSelectWithFiberScheduler: Description: Checks for `IO.select` that is incompatible with Fiber Scheduler. @@ -1421,11 +1421,11 @@ Lint/IncompatibleIoSelectWithFiberScheduler: Lint/IneffectiveAccessModifier: Description: Checks for attempts to use `private` or `protected` to set the visibility of a class method, which does not work. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/InheritException: Description: Avoid inheriting from the `Exception` class. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.41' VersionChanged: '1.26' @@ -1442,7 +1442,7 @@ Lint/InterpolationCheck: Lint/ItWithoutArgumentsInBlock: Description: Checks uses of `it` calls without arguments in block. Reference: https://bugs.ruby-lang.org/issues/18980 - Enabled: true + Enabled: false VersionAdded: '1.59' Lint/LambdaWithoutLiteralBlock: Description: Checks uses of lambda without a literal block. @@ -1450,41 +1450,41 @@ Lint/LambdaWithoutLiteralBlock: VersionAdded: '1.8' Lint/LiteralAsCondition: Description: Checks of literals used in conditions. - Enabled: true + Enabled: false VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: Description: Checks for literal assignments in the conditions. - Enabled: true + Enabled: false VersionAdded: '1.58' Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.32' Lint/Loop: Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests. StyleGuide: "#loop-with-break" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.3' Safe: false Lint/MissingCopEnableDirective: Description: Checks for a `# rubocop:enable` after `# rubocop:disable`. - Enabled: true + Enabled: false VersionAdded: '0.52' MaximumRangeSize: .inf Lint/MissingSuper: Description: Checks for the presence of constructors and lifecycle callbacks without calls to `super`. - Enabled: true + Enabled: false AllowedParentClasses: [] VersionAdded: '0.89' VersionChanged: '1.4' Lint/MixedCaseRange: Description: Checks for mixed-case character ranges since they include likely unintended characters. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '1.53' Lint/MixedRegexpCaptureTypes: @@ -1499,7 +1499,7 @@ Lint/MultipleComparison: Lint/NestedMethodDefinition: Description: Do not use nested method definitions. StyleGuide: "#no-nested-methods" - Enabled: true + Enabled: false AllowedMethods: [] AllowedPatterns: [] VersionAdded: '0.32' @@ -1510,11 +1510,11 @@ Lint/NestedPercentLiteral: Lint/NextWithoutAccumulator: Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/NoReturnInBeginEndBlocks: Description: Do not `return` inside `begin..end` blocks in assignment contexts. - Enabled: true + Enabled: false VersionAdded: '1.2' Lint/NonAtomicFileOperation: Description: Checks for non-atomic file operations. @@ -1529,7 +1529,7 @@ Lint/NonDeterministicRequireOrder: Safe: false Lint/NonLocalExitFromIterator: Description: Do not use return in iterator to cause non-local exit. - Enabled: true + Enabled: false VersionAdded: '0.30' Lint/NumberConversion: Description: Checks unsafe usage of number conversion methods. @@ -1554,7 +1554,7 @@ Lint/OrAssignmentToConstant: Lint/OrderedMagicComments: Description: Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.53' VersionChanged: '1.37' @@ -1567,17 +1567,17 @@ Lint/OutOfRangeRegexpRef: Lint/ParenthesesAsGroupedExpression: Description: Checks for method calls with a space before the opening parenthesis. StyleGuide: "#parens-no-spaces" - Enabled: true + Enabled: false VersionAdded: '0.12' VersionChanged: '0.83' Lint/PercentStringArray: Description: Checks for unwanted commas and quotes in %w/%W literals. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.41' Lint/PercentSymbolArray: Description: Checks for unwanted commas and colons in %i/%I literals. - Enabled: true + Enabled: false VersionAdded: '0.41' Lint/RaiseException: Description: Checks for `raise` or `fail` statements which are raising `Exception` @@ -1592,16 +1592,16 @@ Lint/RaiseException: Lint/RandOne: Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/RedundantCopDisableDirective: Description: 'Checks for rubocop:disable comments that can be removed. Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.' - Enabled: true + Enabled: false VersionAdded: '0.76' Lint/RedundantCopEnableDirective: Description: Checks for rubocop:enable comments that can be removed. - Enabled: true + Enabled: false VersionAdded: '0.76' Lint/RedundantDirGlobSort: Description: Checks for redundant `sort` method to `Dir.glob` and `Dir[]`. @@ -1611,7 +1611,7 @@ Lint/RedundantDirGlobSort: SafeAutoCorrect: false Lint/RedundantRegexpQuantifiers: Description: Checks for redundant quantifiers in Regexps. - Enabled: true + Enabled: false VersionAdded: '1.53' Lint/RedundantRequireStatement: Description: Checks for unnecessary `require` statement. @@ -1633,14 +1633,14 @@ Lint/RedundantSafeNavigation: Safe: false Lint/RedundantSplatExpansion: Description: Checks for splat unnecessarily being called on literals. - Enabled: true + Enabled: false VersionAdded: '0.76' VersionChanged: '1.7' AllowPercentLiteralArrayArgument: true Lint/RedundantStringCoercion: Description: Checks for Object#to_s usage in string interpolation. StyleGuide: "#no-to-s" - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.77' Lint/RedundantWithIndex: @@ -1665,21 +1665,21 @@ Lint/RegexpAsCondition: VersionChanged: '0.86' Lint/RequireParentheses: Description: Use parentheses in the method call to avoid confusion about precedence. - Enabled: true + Enabled: false VersionAdded: '0.18' Lint/RequireRangeParentheses: Description: Checks that a range literal is enclosed in parentheses when the end of the range is at a line break. - Enabled: true + Enabled: false VersionAdded: '1.32' Lint/RequireRelativeSelfPath: Description: Checks for uses a file requiring itself with `require_relative`. - Enabled: true + Enabled: false VersionAdded: '1.22' Lint/RescueException: Description: Avoid rescuing the Exception class. StyleGuide: "#no-blind-rescues" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.27' Lint/RescueType: @@ -1692,7 +1692,7 @@ Lint/ReturnInVoidContext: VersionAdded: '0.50' Lint/SafeNavigationChain: Description: Do not chain ordinary method call after safe navigation operator. - Enabled: true + Enabled: false VersionAdded: '0.47' VersionChanged: '0.77' AllowedMethods: @@ -1740,7 +1740,7 @@ Lint/ShadowedArgument: IgnoreImplicitReferences: false Lint/ShadowedException: Description: Avoid rescuing a higher level exception before a lower level exception. - Enabled: true + Enabled: false VersionAdded: '0.41' Lint/ShadowingOuterLocalVariable: Description: Do not use the same name as outer local variable for block arguments @@ -1754,7 +1754,7 @@ Lint/StructNewOverride: Lint/SuppressedException: Description: Don't suppress exceptions. StyleGuide: "#dont-hide-exceptions" - Enabled: true + Enabled: false AllowComments: true AllowNil: true VersionAdded: '0.9' @@ -1799,7 +1799,7 @@ Lint/TripleQuotes: VersionAdded: '1.9' Lint/UnderscorePrefixedVariableName: Description: Do not use prefix `_` for a variable that is used. - Enabled: true + Enabled: false VersionAdded: '0.21' AllowKeywordBlockArguments: false Lint/UnexpectedBlockArity: @@ -1821,7 +1821,7 @@ Lint/UnexpectedBlockArity: sort: 2 Lint/UnifiedInteger: Description: Use Integer instead of Fixnum or Bignum. - Enabled: true + Enabled: false VersionAdded: '0.43' Lint/UnmodifiedReduceAccumulator: Description: Checks for `reduce` or `inject` blocks that do not update the accumulator @@ -1831,7 +1831,7 @@ Lint/UnmodifiedReduceAccumulator: VersionChanged: '1.5' Lint/UnreachableCode: Description: Unreachable code. - Enabled: true + Enabled: false VersionAdded: '0.9' Lint/UnreachableLoop: Description: Checks for loops that will have at most one iteration. @@ -1843,7 +1843,7 @@ Lint/UnreachableLoop: Lint/UnusedBlockArgument: Description: Checks for unused block arguments. StyleGuide: "#underscore-unused-vars" - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.21' VersionChanged: '1.61' @@ -1873,7 +1873,7 @@ Lint/UriRegexp: VersionAdded: '0.50' Lint/UselessAccessModifier: Description: Checks for useless access modifiers. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.20' VersionChanged: '1.61' @@ -1882,14 +1882,14 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Description: Checks for useless assignment to a local variable. StyleGuide: "#underscore-unused-vars" - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.11' VersionChanged: '1.61' SafeAutoCorrect: false Lint/UselessElseWithoutRescue: Description: Checks for useless `else` in `begin..end` without `rescue`. - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '1.31' Lint/UselessMethodDefinition: @@ -1901,15 +1901,15 @@ Lint/UselessMethodDefinition: Safe: false Lint/UselessRescue: Description: Checks for useless `rescue`s. - Enabled: true + Enabled: false VersionAdded: '1.43' Lint/UselessRuby2Keywords: Description: Finds unnecessary uses of `ruby2_keywords`. - Enabled: true + Enabled: false VersionAdded: '1.23' Lint/UselessSetterCall: Description: Checks for useless setter call to a local variable. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.13' VersionChanged: '1.2' @@ -1922,7 +1922,7 @@ Lint/UselessTimes: VersionChanged: '1.61' Lint/Void: Description: Possible use of operator/literal/variable in void context. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.9' VersionChanged: '1.61' @@ -1956,7 +1956,7 @@ Metrics/BlockLength: Metrics/BlockNesting: Description: Avoid excessive block nesting. StyleGuide: "#three-is-the-number-thou-shalt-count" - Enabled: true + Enabled: false VersionAdded: '0.25' VersionChanged: '0.47' CountBlocks: false @@ -1971,7 +1971,7 @@ Metrics/ClassLength: CountAsOne: [] Metrics/CollectionLiteralLength: Description: Checks for `Array` or `Hash` literals with many entries. - Enabled: true + Enabled: false VersionAdded: '1.47' LengthThreshold: 250 Metrics/CyclomaticComplexity: @@ -2005,7 +2005,7 @@ Metrics/ModuleLength: Metrics/ParameterLists: Description: Avoid parameter lists longer than three or four parameters. StyleGuide: "#too-many-params" - Enabled: true + Enabled: false VersionAdded: '0.25' VersionChanged: '1.5' Max: 5 @@ -2028,19 +2028,19 @@ Migration/DepartmentName: Naming/AccessorMethodName: Description: Check the naming of accessor methods for get_/set_. StyleGuide: "#accessor_mutator_method_names" - Enabled: true + Enabled: false VersionAdded: '0.50' Naming/AsciiIdentifiers: Description: Use only ascii symbols in identifiers and constants. StyleGuide: "#english-identifiers" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '0.87' AsciiConstants: true Naming/BinaryOperatorParameterName: Description: When defining binary operators, name the argument other. StyleGuide: "#other-arg" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.2' Naming/BlockForwarding: @@ -2066,7 +2066,7 @@ Naming/BlockParameterName: Naming/ClassAndModuleCamelCase: Description: Use CamelCase for classes and modules. StyleGuide: "#camelcase-classes" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '0.85' AllowedNames: @@ -2074,12 +2074,12 @@ Naming/ClassAndModuleCamelCase: Naming/ConstantName: Description: Constants should use SCREAMING_SNAKE_CASE. StyleGuide: "#screaming-snake-case" - Enabled: true + Enabled: false VersionAdded: '0.50' Naming/FileName: Description: Use snake_case for source file names. StyleGuide: "#snake-case-files" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.23' Exclude: @@ -2194,7 +2194,7 @@ Naming/MemoizedInstanceVariableName: Naming/MethodName: Description: Use the configured style when naming methods. StyleGuide: "#snake-case-symbols-methods-vars" - Enabled: true + Enabled: false VersionAdded: '0.50' EnforcedStyle: snake_case SupportedStyles: @@ -2230,7 +2230,7 @@ Naming/MethodParameterName: Naming/PredicateName: Description: Check the names of predicate methods. StyleGuide: "#bool-methods-qmark" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '0.77' NamePrefix: @@ -2253,7 +2253,7 @@ Naming/RescuedExceptionsVariableName: Naming/VariableName: Description: Use the configured style when naming variables. StyleGuide: "#snake-case-symbols-methods-vars" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.8' EnforcedStyle: snake_case @@ -2293,19 +2293,19 @@ Security/CompoundHash: VersionChanged: '1.51' Security/Eval: Description: The use of eval represents a serious security risk. - Enabled: true + Enabled: false VersionAdded: '0.47' Security/IoMethods: Description: Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`, `IO.foreach`, and `IO.readlines`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.22' Security/JSONLoad: Description: Prefer usage of `JSON.parse` over `JSON.load` due to potential security issues. See reference for more information. Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load - Enabled: true + Enabled: false VersionAdded: '0.43' VersionChanged: '1.22' SafeAutoCorrect: false @@ -2318,7 +2318,7 @@ Security/MarshalLoad: Security/Open: Description: The use of `Kernel#open` and `URI.open` represent a serious security risk. - Enabled: true + Enabled: false VersionAdded: '0.53' VersionChanged: '1.0' Safe: false @@ -2351,7 +2351,7 @@ Style/AccessorGrouping: Style/Alias: Description: Use alias instead of alias_method. StyleGuide: "#alias-method-lexically" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.36' EnforcedStyle: prefer_alias_method @@ -2361,7 +2361,7 @@ Style/Alias: Style/AndOr: Description: Use &&/|| instead of and/or. StyleGuide: "#no-and-or-or" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.9' VersionChanged: '1.21' @@ -2404,13 +2404,13 @@ Style/ArrayFirstLast: Safe: false Style/ArrayIntersect: Description: Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.40' Style/ArrayJoin: Description: Use Array#join instead of Array#*. StyleGuide: "#array-join" - Enabled: true + Enabled: false VersionAdded: '0.20' VersionChanged: '0.31' Style/AsciiComments: @@ -2424,7 +2424,7 @@ Style/AsciiComments: Style/Attr: Description: Checks for uses of Module#attr. StyleGuide: "#attr" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' Style/AutoResourceCleanup: @@ -2435,7 +2435,7 @@ Style/AutoResourceCleanup: Style/BarePercentLiterals: Description: Checks if usage of %() or %Q() matches configuration. StyleGuide: "#percent-q-shorthand" - Enabled: true + Enabled: false VersionAdded: '0.25' EnforcedStyle: bare_percent SupportedStyles: @@ -2444,7 +2444,7 @@ Style/BarePercentLiterals: Style/BeginBlock: Description: Avoid the use of BEGIN blocks. StyleGuide: "#no-BEGIN-blocks" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/BisectedAttrAccessor: Description: Checks for places where `attr_reader` and `attr_writer` for the same @@ -2454,14 +2454,14 @@ Style/BisectedAttrAccessor: Style/BlockComments: Description: Do not use block comments. StyleGuide: "#no-block-comments" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.23' Style/BlockDelimiters: Description: Avoid using {...} for multi-line blocks (multiline chaining is always ugly). Prefer {...} over do...end for single-line blocks. StyleGuide: "#single-line-blocks" - Enabled: true + Enabled: false VersionAdded: '0.30' VersionChanged: '0.35' EnforcedStyle: line_count_based @@ -2496,7 +2496,7 @@ Style/BlockDelimiters: Style/CaseEquality: Description: Avoid explicit use of the case equality operator(===). StyleGuide: "#no-case-equality" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.89' AllowOnConstant: true @@ -2513,13 +2513,13 @@ Style/CaseLikeIf: Style/CharacterLiteral: Description: Checks for uses of character literals. StyleGuide: "#no-character-literals" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/ClassAndModuleChildren: Description: Checks style of children classes and modules. StyleGuide: "#namespace-definition" SafeAutoCorrect: false - Enabled: true + Enabled: false VersionAdded: '0.19' EnforcedStyle: nested SupportedStyles: @@ -2528,7 +2528,7 @@ Style/ClassAndModuleChildren: Style/ClassCheck: Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`. StyleGuide: "#is-a-vs-kind-of" - Enabled: true + Enabled: false VersionAdded: '0.24' EnforcedStyle: is_a? SupportedStyles: @@ -2550,14 +2550,14 @@ Style/ClassEqualityComparison: Style/ClassMethods: Description: Use self when defining module/class methods. StyleGuide: "#def-self-class-methods" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.20' Style/ClassMethodsDefinitions: Description: Enforces using `def self.method_name` or `class << self` to define class methods. StyleGuide: "#def-self-class-methods" - Enabled: true + Enabled: false VersionAdded: '0.89' EnforcedStyle: self_class SupportedStyles: @@ -2566,7 +2566,7 @@ Style/ClassMethodsDefinitions: Style/ClassVars: Description: Avoid the use of class variables. StyleGuide: "#no-class-vars" - Enabled: true + Enabled: false VersionAdded: '0.13' Style/CollectionCompact: Description: Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject @@ -2597,7 +2597,7 @@ Style/CollectionMethods: Style/ColonMethodCall: Description: 'Do not use :: for method call.' StyleGuide: "#double-colons" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/ColonMethodDefinition: Description: 'Do not use :: for defining class methods.' @@ -2613,7 +2613,7 @@ Style/CombinableLoops: Style/CommandLiteral: Description: Use `` or %x around command literals. StyleGuide: "#percent-x" - Enabled: true + Enabled: false VersionAdded: '0.30' EnforcedStyle: percent_x SupportedStyles: @@ -2625,7 +2625,7 @@ Style/CommentAnnotation: Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE). StyleGuide: "#annotate-keywords" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '1.20' Keywords: @@ -2645,19 +2645,19 @@ Style/CommentedKeyword: Style/ComparableClamp: Description: Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum. - Enabled: true + Enabled: false VersionAdded: '1.44' Style/ConcatArrayLiterals: Description: Enforces the use of `Array#push(item)` instead of `Array#concat([item])` to avoid redundant array literals. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.41' Style/ConditionalAssignment: Description: Use the return value of `if` and `case` statements for assignment to a variable and variable comparison instead of assigning that variable inside of each branch. - Enabled: true + Enabled: false VersionAdded: '0.36' VersionChanged: '0.47' EnforcedStyle: assign_to_condition @@ -2681,14 +2681,14 @@ Style/Copyright: Style/DataInheritance: Description: Checks for inheritance from Data.define. StyleGuide: "#no-extend-data-define" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '1.49' VersionChanged: '1.51' Style/DateTime: Description: Use Time over DateTime. StyleGuide: "#date-time" - Enabled: true + Enabled: false VersionAdded: '0.51' VersionChanged: '0.92' SafeAutoCorrect: false @@ -2696,7 +2696,7 @@ Style/DateTime: Style/DefWithParentheses: Description: Use def with parentheses when there are arguments. StyleGuide: "#method-parens" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' Style/Dir: @@ -2707,7 +2707,7 @@ Style/Dir: Style/DirEmpty: Description: Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty. - Enabled: true + Enabled: false VersionAdded: '1.48' Style/DisableCopsWithinSourceCodeDirective: Description: Forbids disabling/enabling cops within source code. @@ -2756,11 +2756,11 @@ Style/DoubleNegation: Style/EachForSimpleLoop: Description: Use `Integer#times` for a simple loop which iterates a fixed number of times. - Enabled: true + Enabled: false VersionAdded: '0.41' Style/EachWithObject: Description: Prefer `each_with_object` over `inject` or `reduce`. - Enabled: true + Enabled: false VersionAdded: '0.22' VersionChanged: '0.42' Style/EmptyBlockParameter: @@ -2769,11 +2769,11 @@ Style/EmptyBlockParameter: VersionAdded: '0.52' Style/EmptyCaseCondition: Description: Avoid empty condition in case statements. - Enabled: true + Enabled: false VersionAdded: '0.40' Style/EmptyElse: Description: Avoid empty else-clauses. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.28' VersionChanged: '1.61' @@ -2785,7 +2785,7 @@ Style/EmptyElse: AllowComments: true Style/EmptyHeredoc: Description: Checks for using empty heredoc to reduce redundancy. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '1.32' VersionChanged: '1.61' @@ -2796,7 +2796,7 @@ Style/EmptyLambdaParameter: Style/EmptyLiteral: Description: Prefer literals to Array.new/Hash.new/String.new. StyleGuide: "#literal-array-hash" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' Style/EmptyMethod: @@ -2819,13 +2819,13 @@ Style/Encoding: Style/EndBlock: Description: Avoid the use of END blocks. StyleGuide: "#no-END-blocks" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.81' Style/EndlessMethod: Description: Avoid the use of multi-lined endless method definitions. StyleGuide: "#endless-methods" - Enabled: true + Enabled: false VersionAdded: '1.8' EnforcedStyle: allow_single_line SupportedStyles: @@ -2845,12 +2845,12 @@ Style/EvalWithLocation: Style/EvenOdd: Description: Favor the use of `Integer#even?` && `Integer#odd?`. StyleGuide: "#predicate-methods" - Enabled: true + Enabled: false VersionAdded: '0.12' VersionChanged: '0.29' Style/ExactRegexpMatch: Description: Checks for exact regexp match inside Regexp literals. - Enabled: true + Enabled: false VersionAdded: '1.51' Style/ExpandPathArguments: Description: Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`. @@ -2860,7 +2860,7 @@ Style/ExplicitBlockArgument: Description: Consider using explicit block argument to avoid writing block literal that just passes its arguments to another block. StyleGuide: "#block-argument" - Enabled: true + Enabled: false VersionAdded: '0.89' VersionChanged: '1.8' Style/ExponentialNotation: @@ -2884,7 +2884,7 @@ Style/FetchEnvVar: Style/FileEmpty: Description: Prefer to use `File.empty?('path/to/file')` when checking if a file is empty. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.48' Style/FileRead: @@ -2914,7 +2914,7 @@ Style/FloatDivision: Style/For: Description: Checks use of for or each in multiline loops. StyleGuide: "#no-for-loops" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.13' VersionChanged: '1.26' @@ -2925,7 +2925,7 @@ Style/For: Style/FormatString: Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%. StyleGuide: "#sprintf" - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.49' EnforcedStyle: format @@ -2949,7 +2949,7 @@ Style/FormatStringToken: Style/FrozenStringLiteralComment: Description: Add the frozen_string_literal comment to the top of files to help transition to frozen string literals by default. - Enabled: true + Enabled: false VersionAdded: '0.36' VersionChanged: '0.79' EnforcedStyle: always_true @@ -2964,14 +2964,14 @@ Style/FrozenStringLiteralComment: Style/GlobalStdStream: Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`. StyleGuide: "#global-stdout" - Enabled: true + Enabled: false VersionAdded: '0.89' SafeAutoCorrect: false Style/GlobalVars: Description: Do not introduce global variables. StyleGuide: "#instance-vars" Reference: https://www.zenspider.com/ruby/quickref.html - Enabled: true + Enabled: false VersionAdded: '0.13' AllowedVariables: [] Style/GuardClause: @@ -3026,7 +3026,7 @@ Style/HashSyntax: Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.' StyleGuide: "#hash-literals" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.24' EnforcedStyle: ruby19 @@ -3058,13 +3058,13 @@ Style/HashTransformValues: Style/IdenticalConditionalBranches: Description: Checks that conditional statements do not have an identical line at the end of each branch, which can validly be moved out of the conditional. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.36' VersionChanged: '1.19' Style/IfInsideElse: Description: Finds if nodes inside else, which can be converted to elsif. - Enabled: true + Enabled: false AllowIfModifier: false VersionAdded: '0.36' VersionChanged: '1.3' @@ -3076,12 +3076,12 @@ Style/IfUnlessModifier: VersionChanged: '0.30' Style/IfUnlessModifierOfIfUnless: Description: Avoid modifier if/unless usage on conditionals. - Enabled: true + Enabled: false VersionAdded: '0.39' VersionChanged: '0.87' Style/IfWithBooleanLiteralBranches: Description: Checks for redundant `if` with boolean literal branches. - Enabled: true + Enabled: false VersionAdded: '1.9' SafeAutoCorrect: false AllowedMethods: @@ -3089,7 +3089,7 @@ Style/IfWithBooleanLiteralBranches: Style/IfWithSemicolon: Description: Do not use if x; .... Use the ternary operator instead. StyleGuide: "#no-semicolon-ifs" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.83' Style/ImplicitRuntimeError: @@ -3100,14 +3100,14 @@ Style/ImplicitRuntimeError: Style/InPatternThen: Description: Checks for `in;` uses in `case` expressions. StyleGuide: "#no-in-pattern-semicolons" - Enabled: true + Enabled: false VersionAdded: '1.16' Style/InfiniteLoop: Description: Use Kernel#loop for infinite loops. This cop is unsafe if the body may raise a `StopIteration` exception. Safe: false StyleGuide: "#infinite-loop" - Enabled: true + Enabled: false VersionAdded: '0.26' VersionChanged: '0.61' Style/InlineComment: @@ -3132,7 +3132,7 @@ Style/InverseMethods: :select!: :reject! Style/InvertibleUnlessCondition: Description: Favor `if` with inverted condition over `unless`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.44' VersionChanged: '1.50' @@ -3182,7 +3182,7 @@ Style/Lambda: Style/LambdaCall: Description: Use lambda.call(...) instead of lambda.(...). StyleGuide: "#proc-call" - Enabled: true + Enabled: false VersionAdded: '0.13' VersionChanged: '0.14' EnforcedStyle: call @@ -3192,13 +3192,13 @@ Style/LambdaCall: Style/LineEndConcatenation: Description: Use \ instead of + or << to concatenate two string literals at line end. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.18' VersionChanged: '0.64' Style/MagicCommentFormat: Description: Use a consistent style for magic comments. - Enabled: true + Enabled: false VersionAdded: '1.35' EnforcedStyle: snake_case SupportedStyles: @@ -3233,7 +3233,7 @@ Style/MapToSet: Style/MethodCallWithArgsParentheses: Description: Use parentheses for method calls with arguments. StyleGuide: "#method-invocation-parens" - Enabled: true + Enabled: false VersionAdded: '0.47' VersionChanged: '1.7' IgnoreMacros: true @@ -3259,7 +3259,7 @@ Style/MethodCallWithArgsParentheses: Style/MethodCallWithoutArgsParentheses: Description: Do not use parentheses for method calls with no arguments. StyleGuide: "#method-invocation-parens" - Enabled: true + Enabled: false AllowedMethods: [] AllowedPatterns: [] VersionAdded: '0.47' @@ -3272,7 +3272,7 @@ Style/MethodCalledOnDoEndBlock: Style/MethodDefParentheses: Description: Checks if the method definitions have or don't have parentheses. StyleGuide: "#method-parens" - Enabled: true + Enabled: false VersionAdded: '0.16' VersionChanged: '1.7' EnforcedStyle: require_parentheses @@ -3288,7 +3288,7 @@ Style/MinMax: Style/MinMaxComparison: Description: Enforces the use of `max` or `min` instead of comparison for greater or less. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.42' Style/MissingElse: @@ -3306,7 +3306,7 @@ Style/MissingElse: Style/MissingRespondToMissing: Description: Checks if `method_missing` is implemented without implementing `respond_to_missing`. StyleGuide: "#no-method-missing" - Enabled: true + Enabled: false VersionAdded: '0.56' Style/MixinGrouping: Description: Checks for grouping of mixins in `class` and `module` bodies. @@ -3320,12 +3320,12 @@ Style/MixinGrouping: - grouped Style/MixinUsage: Description: Checks that `include`, `extend` and `prepend` exists at the top level. - Enabled: true + Enabled: false VersionAdded: '0.51' Style/ModuleFunction: Description: Checks for usage of `extend self` in modules. StyleGuide: "#module-function" - Enabled: true + Enabled: false VersionAdded: '0.11' VersionChanged: '0.65' EnforcedStyle: extend_self @@ -3348,7 +3348,7 @@ Style/MultilineIfModifier: Style/MultilineIfThen: Description: Do not use then for multi-line if/unless. StyleGuide: "#no-then" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.26' Style/MultilineInPatternThen: @@ -3358,7 +3358,7 @@ Style/MultilineInPatternThen: VersionAdded: '1.16' Style/MultilineMemoization: Description: Wrap multiline memoizations in a `begin` and `end` block. - Enabled: true + Enabled: false VersionAdded: '0.44' VersionChanged: '0.48' EnforcedStyle: keyword @@ -3373,7 +3373,7 @@ Style/MultilineMethodSignature: Style/MultilineTernaryOperator: Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.' StyleGuide: "#no-multiline-ternary" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.86' Style/MultilineWhenThen: @@ -3402,7 +3402,7 @@ Style/MutableConstant: Style/NegatedIf: Description: Favor unless over if for negative conditions (or control flow or). StyleGuide: "#unless-for-negatives" - Enabled: true + Enabled: false VersionAdded: '0.20' VersionChanged: '0.48' EnforcedStyle: both @@ -3428,21 +3428,21 @@ Style/NegatedUnless: Style/NegatedWhile: Description: Favor until over while for negative conditions. StyleGuide: "#until-for-negatives" - Enabled: true + Enabled: false VersionAdded: '0.20' Style/NestedFileDirname: Description: Checks for nested `File.dirname`. - Enabled: true + Enabled: false VersionAdded: '1.26' Style/NestedModifier: Description: Avoid using nested modifiers. StyleGuide: "#no-nested-modifiers" - Enabled: true + Enabled: false VersionAdded: '0.35' Style/NestedParenthesizedCalls: Description: Parenthesize method calls which are nested inside the argument list of another parenthesized method call. - Enabled: true + Enabled: false VersionAdded: '0.36' VersionChanged: '0.77' AllowedMethods: @@ -3466,13 +3466,13 @@ Style/NestedParenthesizedCalls: Style/NestedTernaryOperator: Description: Use one expression per branch in a ternary operator. StyleGuide: "#no-nested-ternary" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.86' Style/Next: Description: Use `next` to skip iteration instead of a condition at the end. StyleGuide: "#no-nested-conditionals" - Enabled: true + Enabled: false VersionAdded: '0.22' VersionChanged: '0.35' EnforcedStyle: skip_modifier_ifs @@ -3483,7 +3483,7 @@ Style/Next: Style/NilComparison: Description: Prefer x.nil? to x == nil. StyleGuide: "#predicate-methods" - Enabled: true + Enabled: false VersionAdded: '0.12' VersionChanged: '0.59' EnforcedStyle: predicate @@ -3498,14 +3498,14 @@ Style/NilLambda: Style/NonNilCheck: Description: Checks for redundant nil checks. StyleGuide: "#no-non-nil-checks" - Enabled: true + Enabled: false VersionAdded: '0.20' VersionChanged: '0.22' IncludeSemanticChanges: false Style/Not: Description: Use ! instead of not. StyleGuide: "#bang-not-not" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.20' Style/NumberedParameters: @@ -3524,7 +3524,7 @@ Style/NumberedParametersLimit: Style/NumericLiteralPrefix: Description: Use smallcase prefixes for numeric literals. StyleGuide: "#numeric-literal-prefixes" - Enabled: true + Enabled: false VersionAdded: '0.41' EnforcedOctalStyle: zero_with_o SupportedOctalStyles: @@ -3570,7 +3570,7 @@ Style/OneLineConditional: Description: Favor the ternary operator (?:) or multi-line constructs over single-line if/then/else/end constructs. StyleGuide: "#ternary-operator" - Enabled: true + Enabled: false AlwaysCorrectToMultiline: false VersionAdded: '0.9' VersionChanged: '0.90' @@ -3579,14 +3579,14 @@ Style/OpenStructUse: due to performance, version compatibility, and potential security issues. Reference: - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats - Enabled: true + Enabled: false Safe: false VersionAdded: '1.23' VersionChanged: '1.51' Style/OperatorMethodCall: Description: Checks for redundant dot before operator method call. StyleGuide: "#operator-method-call" - Enabled: true + Enabled: false VersionAdded: '1.37' Style/OptionHash: Description: Don't use option hashes when you can use keyword arguments. @@ -3605,7 +3605,7 @@ Style/OptionalArguments: Description: Checks for optional arguments that do not appear at the end of the argument list. StyleGuide: "#optional-arguments" - Enabled: true + Enabled: false Safe: false VersionAdded: '0.33' VersionChanged: '0.83' @@ -3626,12 +3626,12 @@ Style/ParallelAssignment: Description: Check for simple usages of parallel assignment. It will only warn when the number of variables matches on both sides of the assignment. StyleGuide: "#parallel-assignment" - Enabled: true + Enabled: false VersionAdded: '0.32' Style/ParenthesesAroundCondition: Description: Don't use parentheses around the condition of an if/unless/while. StyleGuide: "#no-parens-around-condition" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.56' AllowSafeAssignment: true @@ -3651,7 +3651,7 @@ Style/PercentLiteralDelimiters: VersionChanged: '0.48' Style/PercentQLiterals: Description: Checks if uses of %Q/%q match the configured preference. - Enabled: true + Enabled: false VersionAdded: '0.25' EnforcedStyle: lower_case_q SupportedStyles: @@ -3660,12 +3660,12 @@ Style/PercentQLiterals: Style/PerlBackrefs: Description: Avoid Perl-style regex back references. StyleGuide: "#no-perl-regexp-last-matchers" - Enabled: true + Enabled: false VersionAdded: '0.13' Style/PreferredHashMethods: Description: Checks use of `has_key?` and `has_value?` Hash methods. StyleGuide: "#hash-key" - Enabled: true + Enabled: false Safe: false VersionAdded: '0.41' VersionChanged: '0.70' @@ -3676,12 +3676,12 @@ Style/PreferredHashMethods: Style/Proc: Description: Use proc instead of Proc.new. StyleGuide: "#proc" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.18' Style/QuotedSymbols: Description: Use a consistent style for quoted symbols. - Enabled: true + Enabled: false VersionAdded: '1.16' EnforcedStyle: same_as_string_literals SupportedStyles: @@ -3691,7 +3691,7 @@ Style/QuotedSymbols: Style/RaiseArgs: Description: Checks the arguments passed to raise/fail. StyleGuide: "#exception-class-messages" - Enabled: true + Enabled: false Safe: false VersionAdded: '0.14' VersionChanged: '1.61' @@ -3722,7 +3722,7 @@ Style/RedundantArgument: chomp!: "\n" Style/RedundantArrayConstructor: Description: Checks for the instantiation of array using redundant `Array` constructor. - Enabled: true + Enabled: false VersionAdded: '1.52' Style/RedundantAssignment: Description: Checks for redundant assignment before returning. @@ -3731,12 +3731,12 @@ Style/RedundantAssignment: Style/RedundantBegin: Description: Don't use begin blocks when they are not needed. StyleGuide: "#begin-implicit" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '0.21' Style/RedundantCapitalW: Description: Checks for %W when interpolation is not needed. - Enabled: true + Enabled: false VersionAdded: '0.76' Style/RedundantCondition: Description: Checks for unnecessary conditional expressions. @@ -3748,25 +3748,25 @@ Style/RedundantConditional: VersionAdded: '0.50' Style/RedundantConstantBase: Description: Avoid redundant `::` prefix on constant. - Enabled: true + Enabled: false VersionAdded: '1.40' Style/RedundantCurrentDirectoryInPath: Description: Checks for uses a redundant current directory in path. - Enabled: true + Enabled: false VersionAdded: '1.53' Style/RedundantDoubleSplatHashBraces: Description: Checks for redundant uses of double splat hash braces. - Enabled: true + Enabled: false VersionAdded: '1.41' Style/RedundantEach: Description: Checks for redundant `each`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.38' Style/RedundantException: Description: Checks for an obsolete RuntimeException argument in raise/fail. StyleGuide: "#no-explicit-runtimeerror" - Enabled: true + Enabled: false VersionAdded: '0.14' VersionChanged: '0.29' Style/RedundantFetchBlock: @@ -3788,18 +3788,18 @@ Style/RedundantFilterChain: Description: Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods chained to `select`/`filter`/`find_all` and change them to use predicate method instead. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '1.52' VersionChanged: '1.57' Style/RedundantFreeze: Description: Checks usages of Object#freeze on immutable objects. - Enabled: true + Enabled: false VersionAdded: '0.34' VersionChanged: '0.66' Style/RedundantHeredocDelimiterQuotes: Description: Checks for redundant heredoc delimiter quotes. - Enabled: true + Enabled: false VersionAdded: '1.45' Style/RedundantInitialize: Description: Checks for redundant `initialize` methods. @@ -3811,27 +3811,27 @@ Style/RedundantInitialize: VersionChanged: '1.61' Style/RedundantInterpolation: Description: Checks for strings that are just an interpolated expression. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.76' VersionChanged: '1.30' Style/RedundantLineContinuation: Description: Check for redundant line continuation. - Enabled: true + Enabled: false VersionAdded: '1.49' Style/RedundantParentheses: Description: Checks for parentheses that seem not to serve any purpose. - Enabled: true + Enabled: false VersionAdded: '0.36' Style/RedundantPercentQ: Description: Checks for %q/%Q when single quotes or double quotes would do. StyleGuide: "#percent-q" - Enabled: true + Enabled: false VersionAdded: '0.76' Style/RedundantRegexpArgument: Description: Identifies places where argument can be replaced from a deterministic regexp to a string. - Enabled: true + Enabled: false VersionAdded: '1.53' Style/RedundantRegexpCharacterClass: Description: Checks for unnecessary single-element Regexp character classes. @@ -3840,7 +3840,7 @@ Style/RedundantRegexpCharacterClass: Style/RedundantRegexpConstructor: Description: Checks for the instantiation of regexp using redundant `Regexp.new` or `Regexp.compile`. - Enabled: true + Enabled: false VersionAdded: '1.52' Style/RedundantRegexpEscape: Description: Checks for redundant escapes in Regexps. @@ -3849,14 +3849,14 @@ Style/RedundantRegexpEscape: Style/RedundantReturn: Description: Don't use return where it's not required. StyleGuide: "#no-explicit-return" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '0.14' AllowMultipleReturnValues: false Style/RedundantSelf: Description: Don't use self where it's not needed. StyleGuide: "#no-self-unless-required" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '0.13' Style/RedundantSelfAssignment: @@ -3878,16 +3878,16 @@ Style/RedundantSort: Safe: false Style/RedundantSortBy: Description: Use `sort` instead of `sort_by { |x| x }`. - Enabled: true + Enabled: false VersionAdded: '0.36' Style/RedundantStringEscape: Description: Checks for redundant escapes in string literals. - Enabled: true + Enabled: false VersionAdded: '1.37' Style/RegexpLiteral: Description: Use / or %r around regular expressions. StyleGuide: "#percent-r" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.30' EnforcedStyle: mixed @@ -3904,7 +3904,7 @@ Style/RequireOrder: Style/RescueModifier: Description: Avoid using rescue in its modifier form. StyleGuide: "#no-rescue-modifiers" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.34' Style/RescueStandardError: @@ -3917,7 +3917,7 @@ Style/RescueStandardError: - explicit Style/ReturnNil: Description: Use return instead of return nil. - Enabled: true + Enabled: false EnforcedStyle: return SupportedStyles: - return @@ -3926,7 +3926,7 @@ Style/ReturnNil: Style/ReturnNilInPredicateMethodDefinition: Description: Checks if uses of `return` or `return nil` in predicate method definition. StyleGuide: "#bool-methods-qmark" - Enabled: true + Enabled: false SafeAutoCorrect: false AllowedMethods: [] AllowedPatterns: [] @@ -3935,7 +3935,7 @@ Style/SafeNavigation: Description: Transforms usages of a method call safeguarded by a check for the existence of the object to safe navigation (`&.`). Autocorrection is unsafe as it assumes the object will be `nil` or truthy, but never `false`. - Enabled: true + Enabled: false VersionAdded: '0.43' VersionChanged: '1.27' ConvertCodeThatCanStartToReturnNil: false @@ -3950,7 +3950,7 @@ Style/SafeNavigation: Style/Sample: Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`. Reference: https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code - Enabled: true + Enabled: false VersionAdded: '0.30' Style/SelectByRegexp: Description: Prefer grep/grep_v to select/reject with a regexp match. @@ -3961,13 +3961,13 @@ Style/SelfAssignment: Description: Checks for places where self-assignment shorthand should have been used. StyleGuide: "#self-assignment" - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.29' Style/Semicolon: Description: Don't use semicolons to terminate expressions. StyleGuide: "#no-semicolon" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.19' AllowAsExpressionSeparator: false @@ -3980,7 +3980,7 @@ Style/Send: Style/SignalException: Description: Checks for proper usage of fail and raise. StyleGuide: "#prefer-raise-over-fail" - Enabled: true + Enabled: false VersionAdded: '0.11' VersionChanged: '0.37' EnforcedStyle: only_raise @@ -4008,12 +4008,12 @@ Style/SingleLineBlockParams: Style/SingleLineDoEndBlock: Description: Checks for single-line `do`...`end` blocks. StyleGuide: "#single-line-do-end-block" - Enabled: true + Enabled: false VersionAdded: '1.57' Style/SingleLineMethods: Description: Avoid single-line methods. StyleGuide: "#no-single-line-methods" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.8' AllowIfMethodIsEmpty: true @@ -4034,7 +4034,7 @@ Style/SoleNestedConditional: Style/SpecialGlobalVars: Description: Avoid Perl-style global variables. StyleGuide: "#no-cryptic-perlisms" - Enabled: true + Enabled: false VersionAdded: '0.13' VersionChanged: '0.36' SafeAutoCorrect: false @@ -4047,7 +4047,7 @@ Style/SpecialGlobalVars: Style/StabbyLambdaParentheses: Description: Check for the usage of parentheses around stabby lambda arguments. StyleGuide: "#stabby-lambda-with-args" - Enabled: true + Enabled: false VersionAdded: '0.35' EnforcedStyle: require_parentheses SupportedStyles: @@ -4090,7 +4090,7 @@ Style/StringHashKeys: Style/StringLiterals: Description: Checks if uses of quotes match the configured preference. StyleGuide: "#consistent-string-literals" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.36' EnforcedStyle: double_quotes @@ -4101,7 +4101,7 @@ Style/StringLiterals: Style/StringLiteralsInInterpolation: Description: Checks if uses of quotes inside expressions in interpolated strings match the configured preference. - Enabled: true + Enabled: false VersionAdded: '0.27' EnforcedStyle: double_quotes SupportedStyles: @@ -4116,7 +4116,7 @@ Style/StringMethods: intern: to_sym Style/Strip: Description: Use `strip` instead of `lstrip.rstrip`. - Enabled: true + Enabled: false VersionAdded: '0.36' Style/StructInheritance: Description: Checks for inheritance from Struct.new. @@ -4128,7 +4128,7 @@ Style/StructInheritance: Style/SuperWithArgsParentheses: Description: Use parentheses for `super` with arguments. StyleGuide: "#super-with-args" - Enabled: true + Enabled: false VersionAdded: '1.58' Style/SwapValues: Description: Enforces the use of shorthand-style swapping of 2 variables. @@ -4139,7 +4139,7 @@ Style/SwapValues: Style/SymbolArray: Description: Use %i or %I for arrays of symbols. StyleGuide: "#percent-i" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.49' EnforcedStyle: brackets @@ -4149,11 +4149,11 @@ Style/SymbolArray: - brackets Style/SymbolLiteral: Description: Use plain symbols instead of string symbols when possible. - Enabled: true + Enabled: false VersionAdded: '0.30' Style/SymbolProc: Description: Use symbols as procs instead of blocks when possible. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.26' VersionChanged: '1.40' @@ -4164,7 +4164,7 @@ Style/SymbolProc: AllowComments: false Style/TernaryParentheses: Description: Checks for use of parentheses around ternary conditions. - Enabled: true + Enabled: false VersionAdded: '0.42' VersionChanged: '0.46' EnforcedStyle: require_no_parentheses @@ -4180,7 +4180,7 @@ Style/TopLevelMethodDefinition: VersionAdded: '1.15' Style/TrailingBodyOnClass: Description: Class body goes below class statement. - Enabled: true + Enabled: false VersionAdded: '0.53' Style/TrailingBodyOnMethodDefinition: Description: Method body goes below definition. @@ -4188,12 +4188,12 @@ Style/TrailingBodyOnMethodDefinition: VersionAdded: '0.52' Style/TrailingBodyOnModule: Description: Module body goes below module statement. - Enabled: true + Enabled: false VersionAdded: '0.53' Style/TrailingCommaInArguments: Description: Checks for trailing comma in argument lists. StyleGuide: "#no-trailing-params-comma" - Enabled: true + Enabled: false VersionAdded: '0.36' EnforcedStyleForMultiline: comma SupportedStylesForMultiline: @@ -4203,7 +4203,7 @@ Style/TrailingCommaInArguments: Style/TrailingCommaInArrayLiteral: Description: Checks for trailing comma in array literals. StyleGuide: "#no-trailing-array-commas" - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleForMultiline: consistent_comma SupportedStylesForMultiline: @@ -4217,7 +4217,7 @@ Style/TrailingCommaInBlockArgs: VersionAdded: '0.81' Style/TrailingCommaInHashLiteral: Description: Checks for trailing comma in hash literals. - Enabled: true + Enabled: false EnforcedStyleForMultiline: consistent_comma SupportedStylesForMultiline: - comma @@ -4238,7 +4238,7 @@ Style/TrailingUnderscoreVariable: Style/TrivialAccessors: Description: Prefer attr_* methods to trivial readers/writers. StyleGuide: "#attr_family" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.15' ExactNameMatch: true @@ -4266,7 +4266,7 @@ Style/TrivialAccessors: Style/UnlessElse: Description: Do not use unless with else. Rewrite these with the positive case first. StyleGuide: "#no-else-with-unless" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/UnlessLogicalOperators: Description: Checks for use of logical operators in an unless condition. @@ -4285,29 +4285,29 @@ Style/VariableInterpolation: Description: Don't interpolate global, instance and class variables directly in strings. StyleGuide: "#curlies-interpolate" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.20' Style/WhenThen: Description: Use when x then ... for one-line cases. StyleGuide: "#no-when-semicolons" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/WhileUntilDo: Description: Checks for redundant do after while or until. StyleGuide: "#no-multiline-while-do" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/WhileUntilModifier: Description: Favor modifier while/until usage when you have a single-line body. StyleGuide: "#while-as-a-modifier" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.30' Style/WordArray: Description: Use %w or %W for arrays of words. StyleGuide: "#percent-w" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.19' EnforcedStyle: brackets @@ -4319,7 +4319,7 @@ Style/WordArray: Style/YAMLFileRead: Description: Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` with `File.read` argument. - Enabled: true + Enabled: false VersionAdded: '1.53' Style/YodaCondition: Description: Forbid or enforce yoda conditions. @@ -4348,7 +4348,7 @@ Style/YodaExpression: - "^" Style/ZeroLengthPredicate: Description: 'Use #empty? when testing for objects of length 0.' - Enabled: true + Enabled: false Safe: false VersionAdded: '0.37' VersionChanged: '0.39' From 1e74a945bf633145feff506f970d2d7257299a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 20:41:31 +0000 Subject: [PATCH 036/112] Enable Style/FrozenStringLiteralComment We want to have frozen string literals by default. --- rubocop.yml | 1 - test/fixtures/full_config.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 21557e61..112ec402 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1071,7 +1071,6 @@ Style/FormatStringToken: Enabled: false Style/FrozenStringLiteralComment: - Enabled: false SafeAutoCorrect: true EnforcedStyle: always_true Details: 'Add `# frozen_string_literal: true` to the top of the file. Frozen string diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index efbecf1f..be561afa 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2949,7 +2949,7 @@ Style/FormatStringToken: Style/FrozenStringLiteralComment: Description: Add the frozen_string_literal comment to the top of files to help transition to frozen string literals by default. - Enabled: false + Enabled: true VersionAdded: '0.36' VersionChanged: '0.79' EnforcedStyle: always_true From da599ea729f959ce20ed97a9f28a56fad4ea6038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 20:48:18 +0000 Subject: [PATCH 037/112] Enable cops in the Bundler Department Those are just linters trying to help with mistakes. --- rubocop.yml | 12 ------------ test/fixtures/full_config.yml | 8 ++++---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 112ec402..da1300db 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -14,18 +14,6 @@ AllCops: NewCops: disable # New cops will be triaged by style guide maintainers instead. # Bundler Department -Bundler/DuplicatedGem: - Enabled: false - -Bundler/DuplicatedGroup: - Enabled: false - -Bundler/GemFilename: - Enabled: false - -Bundler/InsecureProtocolSource: - Enabled: false - Bundler/OrderedGems: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index be561afa..e1ddf4ac 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -104,7 +104,7 @@ AllCops: ActiveSupportExtensionsEnabled: false Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. - Enabled: false + Enabled: true Severity: warning VersionAdded: '0.46' VersionChanged: '1.40' @@ -114,7 +114,7 @@ Bundler/DuplicatedGem: - "**/gems.rb" Bundler/DuplicatedGroup: Description: Checks for duplicate group entries in Gemfile. - Enabled: false + Enabled: true Severity: warning VersionAdded: '1.56' Include: @@ -134,7 +134,7 @@ Bundler/GemComment: OnlyFor: [] Bundler/GemFilename: Description: Enforces the filename for managing gems. - Enabled: false + Enabled: true VersionAdded: '1.20' EnforcedStyle: Gemfile SupportedStyles: @@ -162,7 +162,7 @@ Bundler/InsecureProtocolSource: Description: The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated because HTTP requests are insecure. Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not. - Enabled: false + Enabled: true Severity: warning VersionAdded: '0.50' VersionChanged: '1.40' From f7e9e3b774caaf669245b9ab2b1f135f208e209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 20:52:05 +0000 Subject: [PATCH 038/112] Enable cops in the Gemspec Department Those are all lints to catch mistakes. --- rubocop.yml | 10 ++-------- test/fixtures/full_config.yml | 8 ++++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index da1300db..c13c4a9f 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -20,13 +20,10 @@ Bundler/OrderedGems: # Gemspec Department Gemspec/DeprecatedAttributeAssignment: - Enabled: false + Enabled: true Gemspec/DevelopmentDependencies: - Enabled: false - -Gemspec/DuplicatedAssignment: - Enabled: false + Enabled: true Gemspec/OrderedDependencies: Enabled: false @@ -37,9 +34,6 @@ Gemspec/RequireMFA: Gemspec/RequiredRubyVersion: Enabled: false -Gemspec/RubyVersionGlobalsUsage: - Enabled: false - # Layout Department Layout/AccessModifierIndentation: diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index e1ddf4ac..e3ebfd98 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -196,7 +196,7 @@ Gemspec/DependencyVersion: Gemspec/DeprecatedAttributeAssignment: Description: Checks that deprecated attribute assignments are not set in a gemspec file. - Enabled: false + Enabled: true Severity: warning VersionAdded: '1.30' VersionChanged: '1.40' @@ -205,7 +205,7 @@ Gemspec/DeprecatedAttributeAssignment: Gemspec/DevelopmentDependencies: Description: Checks that development dependencies are specified in Gemfile rather than gemspec. - Enabled: false + Enabled: true VersionAdded: '1.44' EnforcedStyle: Gemfile SupportedStyles: @@ -220,7 +220,7 @@ Gemspec/DevelopmentDependencies: Gemspec/DuplicatedAssignment: Description: An attribute assignment method calls should be listed only once in a gemspec. - Enabled: false + Enabled: true Severity: warning VersionAdded: '0.52' VersionChanged: '1.40' @@ -257,7 +257,7 @@ Gemspec/RequiredRubyVersion: Gemspec/RubyVersionGlobalsUsage: Description: Checks usage of RUBY_VERSION in gemspec. StyleGuide: "#no-ruby-version-in-the-gemspec" - Enabled: false + Enabled: true Severity: warning VersionAdded: '0.72' VersionChanged: '1.40' From a7a7ae47a704c71f9f19ffd210eab9af8f5c800a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 20:55:44 +0000 Subject: [PATCH 039/112] Drop Ruby 3.0 support --- .github/workflows/ruby.yml | 2 +- rubocop-shopify.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f6d32137..4dab17f6 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: gemfile: [Gemfile, gemfiles/minimum_rubocop.gemfile] - ruby: ["3.0", "3.1", "3.2", "3.3"] + ruby: ["3.1", "3.2", "3.3"] env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index cb7b1a13..2f402e52 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| "allowed_push_host" => "https://rubygems.org", } - s.required_ruby_version = ">= 3.0.0" + s.required_ruby_version = ">= 3.1.0" s.add_dependency("rubocop", "~> 1.51") end From 21d0f467d380e9c706c2b74e705a5d5dedb3063c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 21:44:52 +0000 Subject: [PATCH 040/112] Drop support to Rubocop < 1.62 They don't support Ruby 3.4. --- Gemfile.lock | 2 +- rubocop-shopify.gemspec | 2 +- rubocop.yml | 26 -------------------------- test/fixtures/full_config.yml | 25 +++---------------------- 4 files changed, 5 insertions(+), 50 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 55ed782e..03703f78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rubocop-shopify (2.15.1) - rubocop (~> 1.51) + rubocop (~> 1.62) GEM remote: https://rubygems.org/ diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index 2f402e52..dcd0d18b 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -23,5 +23,5 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 3.1.0" - s.add_dependency("rubocop", "~> 1.51") + s.add_dependency("rubocop", "~> 1.62") end diff --git a/rubocop.yml b/rubocop.yml index c13c4a9f..be92fb9e 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -473,10 +473,8 @@ Lint/InheritException: Lint/InterpolationCheck: Enabled: false -<% if rubocop_version >= '1.59' %> Lint/ItWithoutArgumentsInBlock: Enabled: false -<% end %> Lint/LambdaWithoutLiteralBlock: Enabled: false @@ -484,10 +482,8 @@ Lint/LambdaWithoutLiteralBlock: Lint/LiteralAsCondition: Enabled: false -<% if rubocop_version >= '1.58' %> Lint/LiteralAssignmentInCondition: Enabled: false -<% end %> Lint/LiteralInInterpolation: Enabled: false @@ -501,10 +497,8 @@ Lint/MissingCopEnableDirective: Lint/MissingSuper: Enabled: false -<% if rubocop_version >= '1.53' %> Lint/MixedCaseRange: Enabled: false -<% end %> Lint/MixedRegexpCaptureTypes: Enabled: false @@ -569,10 +563,8 @@ Lint/RedundantCopEnableDirective: Lint/RedundantDirGlobSort: Enabled: false -<% if rubocop_version >= '1.53' %> Lint/RedundantRegexpQuantifiers: Enabled: false -<% end %> Lint/RedundantRequireStatement: Enabled: false @@ -1320,10 +1312,8 @@ Style/RandomWithOffset: Style/RedundantArgument: Enabled: false -<% if rubocop_version >= "1.52" %> Style/RedundantArrayConstructor: Enabled: false -<% end %> Style/RedundantAssignment: Enabled: false @@ -1343,10 +1333,8 @@ Style/RedundantConditional: Style/RedundantConstantBase: Enabled: false -<% if rubocop_version >= "1.53" %> Style/RedundantCurrentDirectoryInPath: Enabled: false -<% end %> Style/RedundantDoubleSplatHashBraces: Enabled: false @@ -1363,10 +1351,8 @@ Style/RedundantFetchBlock: Style/RedundantFileExtensionInRequire: Enabled: false -<% if rubocop_version >= "1.52" %> Style/RedundantFilterChain: Enabled: false -<% end %> Style/RedundantFreeze: Enabled: false @@ -1383,7 +1369,6 @@ Style/RedundantInterpolation: Style/RedundantLineContinuation: Enabled: false -<% if rubocop_version >= "1.53" %> Style/RedundantParentheses: Enabled: false @@ -1392,15 +1377,12 @@ Style/RedundantPercentQ: Style/RedundantRegexpArgument: Enabled: false -<% end %> Style/RedundantRegexpCharacterClass: Enabled: false -<% if rubocop_version >= "1.52" %> Style/RedundantRegexpConstructor: Enabled: false -<% end %> Style/RedundantRegexpEscape: Enabled: false @@ -1436,10 +1418,8 @@ Style/RescueModifier: Style/RescueStandardError: Enabled: false -<% if rubocop_version >= "1.53" %> Style/ReturnNilInPredicateMethodDefinition: Enabled: false -<% end %> Style/SafeNavigation: Enabled: false @@ -1462,10 +1442,8 @@ Style/SignalException: Style/SingleArgumentDig: Enabled: false -<% if rubocop_version >= "1.57" %> Style/SingleLineDoEndBlock: Enabled: false -<% end %> Style/SingleLineMethods: Enabled: false @@ -1505,10 +1483,8 @@ Style/Strip: Style/StructInheritance: Enabled: false -<% if rubocop_version >= "1.58" %> Style/SuperWithArgsParentheses: Enabled: false -<% end %> Style/SwapValues: Enabled: false @@ -1578,10 +1554,8 @@ Style/WordArray: Enabled: false EnforcedStyle: brackets -<% if rubocop_version >= "1.53" %> Style/YAMLFileRead: Enabled: false -<% end %> Style/YodaCondition: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index e3ebfd98..20f5e86a 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -86,6 +86,7 @@ AllCops: - rails rubocop-rspec: - rspec + - rspec-rails rubocop-minitest: - minitest rubocop-sequel: @@ -99,8 +100,6 @@ AllCops: rubocop-factory_bot: - factory_bot - factory_bot_rails - rubocop-rspec_rails: - - rspec-rails ActiveSupportExtensionsEnabled: false Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. @@ -1167,7 +1166,7 @@ Lint/Debugger: Description: Check for debugger calls. Enabled: false VersionAdded: '0.14' - VersionChanged: '1.63' + VersionChanged: '1.46' DebuggerMethods: Kernel: - binding.irb @@ -1178,14 +1177,8 @@ Lint/Debugger: - Kernel.byebug - Kernel.remote_byebug Capybara: - - page.save_and_open_page - - page.save_and_open_screenshot - - page.save_page - - page.save_screenshot - save_and_open_page - save_and_open_screenshot - - save_page - - save_screenshot debug.rb: - binding.b - binding.break @@ -1207,10 +1200,6 @@ Lint/Debugger: - jard WebConsole: - binding.console - DebuggerRequires: - debug.rb: - - debug/open - - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. Enabled: false @@ -2082,8 +2071,7 @@ Naming/FileName: Enabled: false VersionAdded: '0.50' VersionChanged: '1.23' - Exclude: - - "/Rakefile.rb" + Exclude: [] ExpectMatchingDefinition: false CheckDefinitionPathHierarchy: true CheckDefinitionPathHierarchyRoots: @@ -3213,13 +3201,6 @@ Style/MapCompactWithConditionalBlock: Description: Prefer `select` or `reject` over `map { ... }.compact`. Enabled: false VersionAdded: '1.30' -Style/MapIntoArray: - Description: Checks for usages of `each` with `<<`, `push`, or `append` which can - be replaced by `map`. - StyleGuide: "#functional-code" - Enabled: false - VersionAdded: '1.63' - Safe: false Style/MapToHash: Description: Prefer `to_h` with a block over `map.to_h`. Enabled: false From 8cd73fffb34c7ab7800320884e38d556c8fd3846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 12 Feb 2025 22:05:46 +0000 Subject: [PATCH 041/112] Upgrade to latest rubocop version --- Gemfile.lock | 28 ++--- bin/sort-cops | 66 ++++++++++++ rubocop.yml | 117 +++++++++++++++++++++ test/fixtures/full_config.yml | 187 +++++++++++++++++++++++++++++++--- 4 files changed, 368 insertions(+), 30 deletions(-) create mode 100755 bin/sort-cops diff --git a/Gemfile.lock b/Gemfile.lock index 03703f78..153f50e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,12 +12,12 @@ GEM byebug (11.1.3) coderay (1.1.3) diffy (3.4.3) - json (2.7.2) - language_server-protocol (3.17.0.3) + json (2.10.1) + language_server-protocol (3.17.0.4) method_source (1.0.0) minitest (5.25.4) - parallel (1.24.0) - parser (3.3.1.0) + parallel (1.26.3) + parser (3.3.7.1) ast (~> 2.4.1) racc pry (0.14.2) @@ -26,26 +26,26 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - racc (1.7.3) + racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.0) - rexml (3.2.6) - rubocop (1.63.4) + regexp_parser (2.10.0) + rubocop (1.71.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) - unicode-display_width (2.5.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) PLATFORMS ruby diff --git a/bin/sort-cops b/bin/sort-cops new file mode 100755 index 00000000..61a78d94 --- /dev/null +++ b/bin/sort-cops @@ -0,0 +1,66 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'yaml' + +def extract_cop_entries(content) + # Extract all cop configurations (entries that start with a department name) + cop_pattern = /^[A-Z][A-Za-z]+\/[A-Za-z]+:/ + cops = {} + + current_cop = nil + current_config = [] + + content.each_line do |line| + if line.match?(cop_pattern) + # Save previous cop if exists + if current_cop + cops[current_cop] = current_config.join + end + + # Start new cop + current_cop = line.split(':').first + current_config = [line] + elsif current_cop + current_config << line + end + end + + # Save last cop + if current_cop + cops[current_cop] = current_config.join + end + + cops +end + +def sort_cops(file_path) + content = File.read(file_path) + + # Extract header (content before first cop) + first_cop_pattern = /^[A-Z][A-Za-z]+\/[A-Za-z]+:/ + header_end = content.index(content.lines.find { |line| line.match?(first_cop_pattern) }) + header = content[0...header_end] + + # Extract and sort cops + cops = extract_cop_entries(content) + sorted_cops = cops.sort_by { |name, _| name } + + # Generate new content + new_content = header + + sorted_cops.each do |_, config| + new_content << config + end + + # Write sorted content back to file + File.write(file_path, new_content) +end + +if ARGV.empty? + puts "Usage: ruby sort_cops.rb path/to/rubocop.yml" + exit 1 +end + +sort_cops(ARGV[0]) +puts "Successfully sorted cops in #{ARGV[0]}" diff --git a/rubocop.yml b/rubocop.yml index be92fb9e..9cbf760c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -19,6 +19,11 @@ Bundler/OrderedGems: # Gemspec Department +<% if rubocop_version >= "1.65" %> +Gemspec/AddRuntimeDependency: + Enabled: false +<% end %> + Gemspec/DeprecatedAttributeAssignment: Enabled: true @@ -335,6 +340,11 @@ Lint/AmbiguousRange: Lint/AmbiguousRegexpLiteral: Enabled: false +<% if rubocop_version >= "1.71" %> +Lint/ArrayLiteralInRegexp: + Enabled: false +<% end %> + Lint/AssignmentInCondition: Enabled: false @@ -356,6 +366,11 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Enabled: false +<% if rubocop_version >= "1.70" %> +Lint/ConstantReassignment: + Enabled: false +<% end %> + Lint/Debugger: Enabled: false @@ -401,6 +416,11 @@ Lint/DuplicateRequire: Lint/DuplicateRescueException: Enabled: false +<% if rubocop_version >= "1.67" %> +Lint/DuplicateSetElement: + Enabled: false +<% end %> + Lint/EachWithObjectArgument: Enabled: false @@ -455,6 +475,11 @@ Lint/FormatParameterMismatch: Lint/HashCompareByIdentity: Enabled: false +<% if rubocop_version >= "1.69" %> +Lint/HashNewWithKeywordArgumentsAsDefault: + Enabled: false +<% end %> + Lint/IdentityComparison: Enabled: false @@ -530,6 +555,11 @@ Lint/NonLocalExitFromIterator: Lint/NumberedParameterAssignment: Enabled: false +<% if rubocop_version >= "1.69" %> +Lint/NumericOperationWithConstantResult: + Enabled: false +<% end %> + Lint/OrAssignmentToConstant: Enabled: false @@ -635,6 +665,11 @@ Lint/ShadowedException: Lint/ShadowingOuterLocalVariable: Enabled: false +<% if rubocop_version >= "1.70" %> +Lint/SharedMutableDefault: + Enabled: false +<% end %> + Lint/StructNewOverride: Enabled: false @@ -662,6 +697,11 @@ Lint/TripleQuotes: Lint/UnderscorePrefixedVariableName: Enabled: false +<% if rubocop_version >= "1.68" %> +Lint/UnescapedBracketInRegexp: + Enabled: false +<% end %> + Lint/UnexpectedBlockArity: Enabled: false @@ -695,12 +735,22 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Enabled: false +<% if rubocop_version >= "1.69" %> +Lint/UselessDefined: + Enabled: false +<% end %> + Lint/UselessElseWithoutRescue: Enabled: false Lint/UselessMethodDefinition: Enabled: false +<% if rubocop_version >= "1.66" %> +Lint/UselessNumericOperation: + Enabled: false +<% end %> + Lint/UselessRescue: Enabled: false @@ -848,6 +898,11 @@ Style/Alias: Enabled: false EnforcedStyle: prefer_alias_method +<% if rubocop_version >= "1.68" %> +Style/AmbiguousEndlessMethodDefinition: + Enabled: false +<% end %> + Style/AndOr: Enabled: false @@ -872,6 +927,11 @@ Style/BeginBlock: Style/BisectedAttrAccessor: Enabled: false +<% if rubocop_version >= "1.68" %> +Style/BitwisePredicate: + Enabled: false +<% end %> + Style/BlockComments: Enabled: false @@ -916,6 +976,11 @@ Style/ColonMethodCall: Style/ColonMethodDefinition: Enabled: false +<% if rubocop_version >= "1.68" %> +Style/CombinableDefined: + Enabled: false +<% end %> + Style/CombinableLoops: Enabled: false @@ -944,6 +1009,11 @@ Style/DataInheritance: Style/DefWithParentheses: Enabled: false +<% if rubocop_version >= "1.69" %> +Style/DigChain: + Enabled: false +<% end %> + Style/Dir: Enabled: false @@ -1026,9 +1096,19 @@ Style/FetchEnvVar: Style/FileEmpty: Enabled: false +<% if rubocop_version >= "1.69" %> +Style/FileNull: + Enabled: false +<% end %> + Style/FileRead: Enabled: false +<% if rubocop_version >= "1.69" %> +Style/FileTouch: + Enabled: false +<% end %> + Style/FileWrite: Enabled: false @@ -1075,9 +1155,16 @@ Style/HashExcept: Style/HashLikeCase: Enabled: false +<% if rubocop_version >= "1.71" %> +Style/HashSlice: + Enabled: false +<% end %> + Style/HashSyntax: Enabled: false +<% if rubocop_version < "1.67" %> EnforcedShorthandSyntax: either +<% end %> Style/HashTransformKeys: Enabled: false @@ -1112,6 +1199,16 @@ Style/InfiniteLoop: Style/InverseMethods: Enabled: false +<% if rubocop_version >= "1.70" %> +Style/ItAssignment: + Enabled: false +<% end %> + +<% if rubocop_version >= "1.68" %> +Style/KeywordArgumentsMerging: + Enabled: false +<% end %> + Style/KeywordParametersOrder: Enabled: false @@ -1366,6 +1463,11 @@ Style/RedundantInitialize: Style/RedundantInterpolation: Enabled: false +<% if rubocop_version >= "1.66" %> +Style/RedundantInterpolationUnfreeze: + Enabled: false +<% end %> + Style/RedundantLineContinuation: Enabled: false @@ -1424,6 +1526,11 @@ Style/ReturnNilInPredicateMethodDefinition: Style/SafeNavigation: Enabled: false +<% if rubocop_version >= "1.68" %> +Style/SafeNavigationChainLength: + Enabled: false +<% end %> + Style/Sample: Enabled: false @@ -1436,6 +1543,11 @@ Style/SelfAssignment: Style/Semicolon: Enabled: false +<% if rubocop_version >= "1.64" %> +Style/SendWithLiteralMethodName: + Enabled: false +<% end %> + Style/SignalException: Enabled: false @@ -1483,6 +1595,11 @@ Style/Strip: Style/StructInheritance: Enabled: false +<% if rubocop_version >= "1.64" %> +Style/SuperArguments: + Enabled: false +<% end %> + Style/SuperWithArgsParentheses: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 20f5e86a..6b068660 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -70,6 +70,7 @@ AllCops: DisplayStyleGuide: false StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ DocumentationBaseURL: https://docs.rubocop.org/rubocop + DocumentationExtension: ".html" ExtraDetails: false StyleGuideCopsOnly: false EnabledByDefault: false @@ -100,7 +101,10 @@ AllCops: rubocop-factory_bot: - factory_bot - factory_bot_rails + rubocop-rspec_rails: + - rspec-rails ActiveSupportExtensionsEnabled: false + StringLiteralsFrozenByDefault: Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. Enabled: true @@ -181,6 +185,14 @@ Bundler/OrderedGems: - "**/*.gemfile" - "**/Gemfile" - "**/gems.rb" +Gemspec/AddRuntimeDependency: + Description: Prefer `add_dependency` over `add_runtime_dependency`. + StyleGuide: "#add_dependency_vs_add_runtime_dependency" + Reference: https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316 + Enabled: false + VersionAdded: '1.65' + Include: + - "**/*.gemspec" Gemspec/DependencyVersion: Description: Requires or forbids specifying gem dependency versions. Enabled: false @@ -592,6 +604,7 @@ Layout/FirstMethodArgumentLineBreak: Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: true + AllowedMethods: [] Layout/FirstMethodParameterLineBreak: Description: Checks for a line break before the first parameter in a multi-line method parameter definition. @@ -684,6 +697,8 @@ Layout/LeadingCommentSpace: VersionChanged: '0.73' AllowDoxygenCommentStyle: false AllowGemfileRubyComment: false + AllowRBSInlineAnnotation: false + AllowSteepAnnotation: false Layout/LeadingEmptyLines: Description: Check for unnecessary blank lines at the beginning of a file. Enabled: false @@ -722,7 +737,7 @@ Layout/LineLength: StyleGuide: "#max-line-length" Enabled: false VersionAdded: '0.25' - VersionChanged: '1.4' + VersionChanged: '1.69' Max: 120 AllowHeredoc: true AllowURI: true @@ -733,6 +748,7 @@ Layout/LineLength: AllowedPatterns: - "\\A\\s*(remote_)?test(_\\w+)?\\s.*(do|->)(\\s|\\Z)" - "\\A\\s*def test_\\w+\\s*\\Z" + SplitStrings: false Layout/MultilineArrayBraceLayout: Description: Checks that the closing brace in an array literal is either on the same line as the last array element, or a new line. @@ -1114,6 +1130,11 @@ Lint/AmbiguousRegexpLiteral: Enabled: false VersionAdded: '0.17' VersionChanged: '0.83' +Lint/ArrayLiteralInRegexp: + Description: Checks for an array literal interpolated inside a regexp. + Enabled: false + VersionAdded: '1.71' + SafeAutoCorrect: false Lint/AssignmentInCondition: Description: Don't use assignment in conditions. StyleGuide: "#safe-assignment-in-condition" @@ -1131,7 +1152,7 @@ Lint/BinaryOperatorWithIdenticalOperands: Enabled: false Safe: false VersionAdded: '0.89' - VersionChanged: '1.7' + VersionChanged: '1.69' Lint/BooleanSymbol: Description: Check for `:true` and `:false` symbols. Enabled: false @@ -1156,6 +1177,10 @@ Lint/ConstantOverwrittenInRescue: `rescue =>`. Enabled: false VersionAdded: '1.31' +Lint/ConstantReassignment: + Description: Checks for constant reassignments. + Enabled: false + VersionAdded: '1.70' Lint/ConstantResolution: Description: Check that constants are fully qualified with `::`. Enabled: false @@ -1166,7 +1191,7 @@ Lint/Debugger: Description: Check for debugger calls. Enabled: false VersionAdded: '0.14' - VersionChanged: '1.46' + VersionChanged: '1.63' DebuggerMethods: Kernel: - binding.irb @@ -1177,8 +1202,14 @@ Lint/Debugger: - Kernel.byebug - Kernel.remote_byebug Capybara: + - page.save_and_open_page + - page.save_and_open_screenshot + - page.save_page + - page.save_screenshot - save_and_open_page - save_and_open_screenshot + - save_page + - save_screenshot debug.rb: - binding.b - binding.break @@ -1200,6 +1231,10 @@ Lint/Debugger: - jard WebConsole: - binding.console + DebuggerRequires: + debug.rb: + - debug/open + - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. Enabled: false @@ -1249,6 +1284,7 @@ Lint/DuplicateBranch: VersionChanged: '1.7' IgnoreLiteralBranches: false IgnoreConstantBranches: false + IgnoreDuplicateElseBranch: false Lint/DuplicateCaseCondition: Description: Do not repeat values in case conditionals. Enabled: false @@ -1288,6 +1324,10 @@ Lint/DuplicateRescueException: Description: Checks that there are no repeated exceptions used in `rescue` expressions. Enabled: false VersionAdded: '0.89' +Lint/DuplicateSetElement: + Description: Checks for duplicate elements in Set. + Enabled: false + VersionAdded: '1.67' Lint/EachWithObjectArgument: Description: Check for immutable argument given to each_with_object. Enabled: false @@ -1385,6 +1425,11 @@ Lint/HashCompareByIdentity: Enabled: false Safe: false VersionAdded: '0.93' +Lint/HashNewWithKeywordArgumentsAsDefault: + Description: Checks for the deprecated use of keyword arguments for hash default + in `Hash.new`. + Enabled: false + VersionAdded: '1.69' Lint/HeredocMethodCallPosition: Description: Checks for the ordering of a method call where the receiver of the call is a HEREDOC. @@ -1535,6 +1580,10 @@ Lint/NumberedParameterAssignment: Description: Checks for uses of numbered parameter assignment. Enabled: false VersionAdded: '1.9' +Lint/NumericOperationWithConstantResult: + Description: Checks for numeric operations with constant results. + Enabled: false + VersionAdded: '1.69' Lint/OrAssignmentToConstant: Description: Checks unintended or-assignment to constant. Enabled: false @@ -1692,9 +1741,9 @@ Lint/SafeNavigationChain: - try! - in? Lint/SafeNavigationConsistency: - Description: Check to make sure that if safe navigation is used for a method call - in an `&&` or `||` condition that safe navigation is used for all method calls - on that same object. + Description: Check to make sure that if safe navigation is used in an `&&` or `||` + condition, consistent and appropriate safe navigation, without excess or deficiency, + is used for all method calls on the same object. Enabled: false VersionAdded: '0.55' VersionChanged: '0.77' @@ -1736,6 +1785,11 @@ Lint/ShadowingOuterLocalVariable: or block local variables. Enabled: false VersionAdded: '0.9' +Lint/SharedMutableDefault: + Description: Checks for mutable literals used as default arguments during Hash initialization. + StyleGuide: "#no-mutable-defaults" + Enabled: false + VersionAdded: '1.70' Lint/StructNewOverride: Description: Disallow overriding the `Struct` built-in methods via `Struct.new`. Enabled: false @@ -1791,6 +1845,10 @@ Lint/UnderscorePrefixedVariableName: Enabled: false VersionAdded: '0.21' AllowKeywordBlockArguments: false +Lint/UnescapedBracketInRegexp: + Description: Checks for unescaped literal `]` in Regexp. + Enabled: false + VersionAdded: '1.68' Lint/UnexpectedBlockArity: Description: Looks for blocks that have fewer arguments that the calling method expects. @@ -1844,10 +1902,12 @@ Lint/UnusedMethodArgument: Enabled: false AutoCorrect: contextual VersionAdded: '0.21' - VersionChanged: '1.61' + VersionChanged: '1.69' AllowUnusedKeywordArguments: false IgnoreEmptyMethods: true IgnoreNotImplementedMethods: true + NotImplementedExceptions: + - NotImplementedError Lint/UriEscapeUnescape: Description: "`URI.escape` method is obsolete and should not be used. Instead, use `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component` depending @@ -1874,8 +1934,12 @@ Lint/UselessAssignment: Enabled: false AutoCorrect: contextual VersionAdded: '0.11' - VersionChanged: '1.61' - SafeAutoCorrect: false + VersionChanged: '1.66' +Lint/UselessDefined: + Description: Checks for calls to `defined?` with strings and symbols. The result + of such a call will always be truthy. + Enabled: false + VersionAdded: '1.69' Lint/UselessElseWithoutRescue: Description: Checks for useless `else` in `begin..end` without `rescue`. Enabled: false @@ -1888,6 +1952,10 @@ Lint/UselessMethodDefinition: VersionAdded: '0.90' VersionChanged: '1.61' Safe: false +Lint/UselessNumericOperation: + Description: Checks for useless numeric operations. + Enabled: false + VersionAdded: '1.66' Lint/UselessRescue: Description: Checks for useless `rescue`s. Enabled: false @@ -1947,8 +2015,9 @@ Metrics/BlockNesting: StyleGuide: "#three-is-the-number-thou-shalt-count" Enabled: false VersionAdded: '0.25' - VersionChanged: '0.47' + VersionChanged: '1.65' CountBlocks: false + CountModifierForms: false Max: 3 Metrics/ClassLength: Description: Avoid classes longer than 100 lines of code. @@ -2071,7 +2140,8 @@ Naming/FileName: Enabled: false VersionAdded: '0.50' VersionChanged: '1.23' - Exclude: [] + Exclude: + - "/Rakefile.rb" ExpectMatchingDefinition: false CheckDefinitionPathHierarchy: true CheckDefinitionPathHierarchyRoots: @@ -2321,12 +2391,14 @@ Style/AccessModifierDeclarations: Description: Checks style of how access modifiers are used. Enabled: false VersionAdded: '0.57' - VersionChanged: '0.81' + VersionChanged: '1.70' EnforcedStyle: group SupportedStyles: - inline - group AllowModifiersOnSymbols: true + AllowModifiersOnAttrs: true + AllowModifiersOnAliasMethod: true SafeAutoCorrect: false Style/AccessorGrouping: Description: Checks for grouping of accessors in `class` and `module` bodies. @@ -2346,6 +2418,11 @@ Style/Alias: SupportedStyles: - prefer_alias - prefer_alias_method +Style/AmbiguousEndlessMethodDefinition: + Description: Checks for endless methods inside operators of lower precedence. + StyleGuide: "#ambiguous-endless-method-defintions" + Enabled: false + VersionAdded: '1.68' Style/AndOr: Description: Use &&/|| instead of and/or. StyleGuide: "#no-and-or-or" @@ -2439,6 +2516,12 @@ Style/BisectedAttrAccessor: method can be combined into single `attr_accessor`. Enabled: false VersionAdded: '0.87' +Style/BitwisePredicate: + Description: Prefer bitwise predicate methods over direct comparison operations. + StyleGuide: "#bitwise-predicate-methods" + Enabled: false + Safe: false + VersionAdded: '1.68' Style/BlockComments: Description: Do not use block comments. StyleGuide: "#no-block-comments" @@ -2592,6 +2675,11 @@ Style/ColonMethodDefinition: StyleGuide: "#colon-method-definition" Enabled: false VersionAdded: '0.52' +Style/CombinableDefined: + Description: Checks successive `defined?` calls that can be combined into a single + call. + Enabled: false + VersionAdded: '1.68' Style/CombinableLoops: Description: Checks for places where multiple consecutive loops over the same data can be combined into a single loop. @@ -2687,6 +2775,11 @@ Style/DefWithParentheses: Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' +Style/DigChain: + Description: Use `dig` with multiple parameters instead of chaining multiple calls. + Enabled: false + Safe: false + VersionAdded: '1.69' Style/Dir: Description: Use the `__dir__` method to retrieve the canonicalized absolute path to the current file. @@ -2722,6 +2815,7 @@ Style/DocumentationMethod: Description: Checks for missing documentation comment for public methods. Enabled: false VersionAdded: '0.43' + AllowedMethods: [] Exclude: - "/spec/**/*" - "/test/**/*" @@ -2875,11 +2969,21 @@ Style/FileEmpty: Enabled: false Safe: false VersionAdded: '1.48' +Style/FileNull: + Description: Use `File::NULL` instead of hardcoding "dev/null". + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.69' Style/FileRead: Description: Favor `File.(bin)read` convenience methods. StyleGuide: "#file-read" Enabled: false VersionAdded: '1.24' +Style/FileTouch: + Description: Favor `FileUtils.touch` for touching files. + Enabled: false + VersionAdded: '1.69' + SafeAutoCorrect: false Style/FileWrite: Description: Favor `File.(bin)write` convenience methods. StyleGuide: "#file-write" @@ -2946,6 +3050,8 @@ Style/FrozenStringLiteralComment: - always_true - never SafeAutoCorrect: true + Exclude: + - "/**/*.arb" Details: 'Add `# frozen_string_literal: true` to the top of the file. Frozen string literals will become the default in a future Ruby version, and we want to make sure we''re ready.' @@ -3010,13 +3116,19 @@ Style/HashLikeCase: Enabled: false VersionAdded: '0.88' MinBranchesCount: 3 +Style/HashSlice: + Description: Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` + methods that can be replaced with `Hash#slice` method. + Enabled: false + Safe: false + VersionAdded: '1.71' Style/HashSyntax: Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.' StyleGuide: "#hash-literals" Enabled: false VersionAdded: '0.9' - VersionChanged: '1.24' + VersionChanged: '1.67' EnforcedStyle: ruby19 SupportedStyles: - ruby19 @@ -3029,6 +3141,7 @@ Style/HashSyntax: - never - either - consistent + - either_consistent UseHashRocketsWithSymbolValues: false PreferHashRocketsForNonAlnumEndingSymbols: false Style/HashTransformKeys: @@ -3149,6 +3262,16 @@ Style/IpAddresses: - "/**/Gemfile" - "/**/gems.rb" - "/**/*.gemspec" +Style/ItAssignment: + Description: Checks for assignment to `it` inside a block. + Enabled: false + VersionAdded: '1.70' +Style/KeywordArgumentsMerging: + Description: When passing an existing hash as keyword arguments, provide additional + arguments directly rather than using `merge`. + StyleGuide: "#merging-keyword-arguments" + Enabled: false + VersionAdded: '1.68' Style/KeywordParametersOrder: Description: Enforces that optional keyword parameters are placed at the end of the parameters list. @@ -3201,6 +3324,14 @@ Style/MapCompactWithConditionalBlock: Description: Prefer `select` or `reject` over `map { ... }.compact`. Enabled: false VersionAdded: '1.30' +Style/MapIntoArray: + Description: Checks for usages of `each` with `<<`, `push`, or `append` which can + be replaced by `map`. + StyleGuide: "#functional-code" + Enabled: false + VersionAdded: '1.63' + VersionChanged: '1.67' + Safe: false Style/MapToHash: Description: Prefer `to_h` with a block over `map.to_h`. Enabled: false @@ -3732,7 +3863,7 @@ Style/RedundantConstantBase: Enabled: false VersionAdded: '1.40' Style/RedundantCurrentDirectoryInPath: - Description: Checks for uses a redundant current directory in path. + Description: Checks for a redundant current directory in a path given to `require_relative`. Enabled: false VersionAdded: '1.53' Style/RedundantDoubleSplatHashBraces: @@ -3796,6 +3927,10 @@ Style/RedundantInterpolation: SafeAutoCorrect: false VersionAdded: '0.76' VersionChanged: '1.30' +Style/RedundantInterpolationUnfreeze: + Description: Checks for redundant unfreezing of interpolated strings. + Enabled: false + VersionAdded: '1.66' Style/RedundantLineContinuation: Description: Check for redundant line continuation. Enabled: false @@ -3912,13 +4047,14 @@ Style/ReturnNilInPredicateMethodDefinition: AllowedMethods: [] AllowedPatterns: [] VersionAdded: '1.53' + VersionChanged: '1.67' Style/SafeNavigation: Description: Transforms usages of a method call safeguarded by a check for the existence of the object to safe navigation (`&.`). Autocorrection is unsafe as it assumes the object will be `nil` or truthy, but never `false`. Enabled: false VersionAdded: '0.43' - VersionChanged: '1.27' + VersionChanged: '1.67' ConvertCodeThatCanStartToReturnNil: false AllowedMethods: - present? @@ -3928,6 +4064,13 @@ Style/SafeNavigation: - try! SafeAutoCorrect: false MaxChainLength: 2 +Style/SafeNavigationChainLength: + Description: Enforces safe navigation chains length to not exceed the configured + maximum. + StyleGuide: "#safe-navigation" + Enabled: false + VersionAdded: '1.68' + Max: 2 Style/Sample: Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`. Reference: https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code @@ -3958,6 +4101,13 @@ Style/Send: StyleGuide: "#prefer-public-send" Enabled: false VersionAdded: '0.33' +Style/SendWithLiteralMethodName: + Description: Detects the use of the `public_send` method with a static method name + argument. + Enabled: false + Safe: false + AllowSend: true + VersionAdded: '1.64' Style/SignalException: Description: Checks for proper usage of fail and raise. StyleGuide: "#prefer-raise-over-fail" @@ -4106,6 +4256,11 @@ Style/StructInheritance: SafeAutoCorrect: false VersionAdded: '0.29' VersionChanged: '1.20' +Style/SuperArguments: + Description: Call `super` without arguments and parentheses when the signature is + identical. + Enabled: false + VersionAdded: '1.64' Style/SuperWithArgsParentheses: Description: Use parentheses for `super` with arguments. StyleGuide: "#super-with-args" @@ -4137,7 +4292,7 @@ Style/SymbolProc: Enabled: false Safe: false VersionAdded: '0.26' - VersionChanged: '1.40' + VersionChanged: '1.64' AllowMethodsWithArguments: false AllowedMethods: - define_method From bffeb3964b559f26f890c17e013c36ed4712cfb8 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 13 Feb 2025 21:02:24 +0000 Subject: [PATCH 042/112] Add `dev.yml` This allows Shopify employees to quickly get this repo set up. Contributors not using Shopify's internal tooling should install Ruby and gems using their preferred method. --- dev.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 dev.yml diff --git a/dev.yml b/dev.yml new file mode 100644 index 00000000..1fd373ab --- /dev/null +++ b/dev.yml @@ -0,0 +1,3 @@ +up: + - ruby + - bundler From 3c11586c9afafe192dcc81f3677f85306d49a97a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 18:52:07 +0000 Subject: [PATCH 043/112] Bump rubocop from 1.63.4 to 1.72.2 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.63.4 to 1.72.2. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.63.4...v1.72.2) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 153f50e3..63869bc7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,6 +14,7 @@ GEM diffy (3.4.3) json (2.10.1) language_server-protocol (3.17.0.4) + lint_roller (1.1.0) method_source (1.0.0) minitest (5.25.4) parallel (1.26.3) @@ -30,9 +31,10 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) - rubocop (1.71.2) + rubocop (1.72.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) From f50082a2539235dc6111d447d60aff2ec0d5e42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 13 Feb 2025 16:49:51 +0000 Subject: [PATCH 044/112] Enable cops in the Layout Department Those cops don't change how you can express yourself in Ruby, but help you to format your code automatically. - [Layout/AccessModifierIndentation](https://docs.rubocop.org/rubocop/cops_layout.html#layoutaccessmodifierindentation) - [Layout/ArgumentAlignment](https://docs.rubocop.org/rubocop/cops_layout.html#layoutargumentalignment) - [Layout/ClosingParenthesisIndentation](https://docs.rubocop.org/rubocop/cops_layout.html#layoutclosingparenthesisindentation) - [Layout/CommentIndentation](https://docs.rubocop.org/rubocop/cops_layout.html#layoutcommentindentation) - [Layout/ConditionPosition](https://docs.rubocop.org/rubocop/cops_layout.html#layoutconditionposition) - [Layout/DefEndAlignment](https://docs.rubocop.org/rubocop/cops_layout.html#layoutdefendalignment) - [Layout/DotPosition](https://docs.rubocop.org/rubocop/cops_layout.html#layoutdotposition) - [Layout/ElseAlignment](https://docs.rubocop.org/rubocop/cops_layout.html#layoutelsealignment) - [Layout/EmptyLineAfterMagicComment](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylineaftermagiccomment) - [Layout/EmptyLineBetweenDefs](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinebetweendefs) - [Layout/EmptyLinesAroundAccessModifier](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundaccessmodifier) - [Layout/EmptyLinesAroundArguments](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundarguments) - [Layout/EmptyLinesAroundAttributeAccessor](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundattributeaccessor) - [Layout/EmptyLinesAroundBlockBody](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundblockbody) - [Layout/EmptyLinesAroundClassBody](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundclassbody) - [Layout/EmptyLinesAroundExceptionHandlingKeywords](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundexceptionhandlingkeywords) - [Layout/EmptyLinesAroundMethodBody](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundmethodbody) - [Layout/EmptyLinesAroundModuleBody](https://docs.rubocop.org/rubocop/cops_layout.html#layoutemptylinesaroundmodulebody) - [Layout/EndOfLine](https://docs.rubocop.org/rubocop/cops_layout.html#layoutendofline) - [Layout/IndentationConsistency](https://docs.rubocop.org/rubocop/cops_layout.html#layoutindentationconsistency) - [Layout/IndentationStyle](https://docs.rubocop.org/rubocop/cops_layout.html#layoutindentationstyle) - [Layout/InitialIndentation](https://docs.rubocop.org/rubocop/cops_layout.html#layoutinitialindentation) - [Layout/LeadingCommentSpace](https://docs.rubocop.org/rubocop/cops_layout.html#layoutleadingcommentspace) - [Layout/LeadingEmptyLines](https://docs.rubocop.org/rubocop/cops_layout.html#layoutleadingemptylines) - [Layout/LineContinuationLeadingSpace](https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinecontinuationleadingspace) - [Layout/LineContinuationSpacing](https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinecontinuationspacing) - [Layout/SpaceAfterColon](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceaftercolon) - [Layout/SpaceAfterComma](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceaftercomma) - [Layout/SpaceAfterMethodName](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceaftermethodname) - [Layout/SpaceAfterNot](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceafternot) - [Layout/SpaceAfterSemicolon](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceaftersemicolon) - [Layout/SpaceAroundBlockParameters](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacearoundblockparameters) - [Layout/SpaceAroundEqualsInParameterDefault](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacearoundequalsinparameterdefault) - [Layout/SpaceAroundKeyword](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacearoundkeyword) - [Layout/SpaceAroundMethodCallOperator](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacearoundmethodcalloperator) - [Layout/SpaceAroundOperators](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacearoundoperators) - [Layout/SpaceBeforeBlockBraces](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacebeforeblockbraces) - [Layout/SpaceBeforeBrackets](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacebeforebrackets) - [Layout/SpaceBeforeComma](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacebeforecomma) - [Layout/SpaceBeforeComment](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacebeforecomment) - [Layout/SpaceBeforeFirstArg](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacebeforefirstarg) - [Layout/SpaceBeforeSemicolon](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspacebeforesemicolon) - [Layout/SpaceInLambdaLiteral](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinlambdaliteral) - [Layout/SpaceInsideArrayLiteralBrackets](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidearrayliteralbrackets) - [Layout/SpaceInsideArrayPercentLiteral](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidearraypercentliteral) - [Layout/SpaceInsideArrayPercentLiteral](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidearraypercentliteral) - [Layout/SpaceInsideBlockBraces](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsideblockbraces) - [Layout/SpaceInsideHashLiteralBraces](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidehashliteralbraces) - [Layout/SpaceInsideParens](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsideparens) - [Layout/SpaceInsidePercentLiteralDelimiters](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidepercentliteraldelimiters) - [Layout/SpaceInsideRangeLiteral](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsiderangeliteral) - [Layout/SpaceInsideReferenceBrackets](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidereferencebrackets) - [Layout/SpaceInsideStringInterpolation](https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsidestringinterpolation) - [Layout/TrailingEmptyLines](https://docs.rubocop.org/rubocop/cops_layout.html#layouttrailingemptylines) - [Layout/TrailingWhitespace](https://docs.rubocop.org/rubocop/cops_layout.html#layouttrailingwhitespace) --- rubocop.yml | 166 +--------------------------------- test/fixtures/full_config.yml | 114 +++++++++++------------ 2 files changed, 60 insertions(+), 220 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 9cbf760c..5cfe5c34 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -41,11 +41,7 @@ Gemspec/RequiredRubyVersion: # Layout Department -Layout/AccessModifierIndentation: - Enabled: false - Layout/ArgumentAlignment: - Enabled: false EnforcedStyle: with_fixed_indentation Layout/ArrayAlignment: @@ -70,73 +66,19 @@ Layout/CaseIndentation: Layout/ClosingHeredocIndentation: Enabled: false -Layout/ClosingParenthesisIndentation: - Enabled: false - -Layout/CommentIndentation: - Enabled: false - -Layout/ConditionPosition: - Enabled: false - -Layout/DefEndAlignment: - Enabled: false - -Layout/DotPosition: - Enabled: false - -Layout/ElseAlignment: - Enabled: false - Layout/EmptyComment: Enabled: false Layout/EmptyLineAfterGuardClause: Enabled: false -Layout/EmptyLineAfterMagicComment: - Enabled: false - -Layout/EmptyLineBetweenDefs: - Enabled: false - Layout/EmptyLines: Enabled: false -Layout/EmptyLinesAroundAccessModifier: - Enabled: false - -Layout/EmptyLinesAroundArguments: - Enabled: false - -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: false - -Layout/EmptyLinesAroundBeginBody: - Enabled: false - -Layout/EmptyLinesAroundBlockBody: - Enabled: false - -Layout/EmptyLinesAroundClassBody: - Enabled: false - -Layout/EmptyLinesAroundExceptionHandlingKeywords: - Enabled: false - -Layout/EmptyLinesAroundMethodBody: - Enabled: false - -Layout/EmptyLinesAroundModuleBody: - Enabled: false - Layout/EndAlignment: Enabled: false EnforcedStyleAlignWith: variable -Layout/EndOfLine: - Enabled: false - Layout/ExtraSpacing: Enabled: false @@ -168,29 +110,11 @@ Layout/HashAlignment: Layout/HeredocIndentation: Enabled: false -Layout/IndentationConsistency: - Enabled: false - -Layout/IndentationStyle: - Enabled: false - -Layout/IndentationWidth: - Enabled: false - -Layout/InitialIndentation: - Enabled: false - -Layout/LeadingCommentSpace: - Enabled: false - -Layout/LeadingEmptyLines: - Enabled: false - Layout/LineContinuationLeadingSpace: - Enabled: false + Enabled: true Layout/LineContinuationSpacing: - Enabled: false + Enabled: true Layout/LineEndStringConcatenationIndentation: Enabled: false @@ -208,9 +132,6 @@ Layout/MultilineArrayBraceLayout: Layout/MultilineArrayLineBreaks: AllowMultilineFinalElement: true -Layout/MultilineBlockLayout: - Enabled: false - Layout/MultilineHashBraceLayout: Enabled: false @@ -236,89 +157,8 @@ Layout/ParameterAlignment: Layout/RescueEnsureAlignment: Enabled: false -Layout/SpaceAfterColon: - Enabled: false - -Layout/SpaceAfterComma: - Enabled: false - -Layout/SpaceAfterMethodName: - Enabled: false - -Layout/SpaceAfterNot: - Enabled: false - -Layout/SpaceAfterSemicolon: - Enabled: false - -Layout/SpaceAroundBlockParameters: - Enabled: false - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: false - -Layout/SpaceAroundKeyword: - Enabled: false - -Layout/SpaceAroundMethodCallOperator: - Enabled: false - -Layout/SpaceAroundOperators: - Enabled: false - -Layout/SpaceBeforeBlockBraces: - Enabled: false - Layout/SpaceBeforeBrackets: - Enabled: false - -Layout/SpaceBeforeComma: - Enabled: false - -Layout/SpaceBeforeComment: - Enabled: false - -Layout/SpaceBeforeFirstArg: - Enabled: false - -Layout/SpaceBeforeSemicolon: - Enabled: false - -Layout/SpaceInLambdaLiteral: - Enabled: false - -Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false - -Layout/SpaceInsideArrayPercentLiteral: - Enabled: false - -Layout/SpaceInsideBlockBraces: - Enabled: false - -Layout/SpaceInsideHashLiteralBraces: - Enabled: false - -Layout/SpaceInsideParens: - Enabled: false - -Layout/SpaceInsidePercentLiteralDelimiters: - Enabled: false - -Layout/SpaceInsideRangeLiteral: - Enabled: false - -Layout/SpaceInsideReferenceBrackets: - Enabled: false - -Layout/SpaceInsideStringInterpolation: - Enabled: false - -Layout/TrailingEmptyLines: - Enabled: false - -Layout/TrailingWhitespace: - Enabled: false + Enabled: true # Lint Department diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 6b068660..c23f53a4 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -277,7 +277,7 @@ Gemspec/RubyVersionGlobalsUsage: Layout/AccessModifierIndentation: Description: Check indentation of private/protected visibility modifiers. StyleGuide: "#indent-public-private-protected" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: indent SupportedStyles: @@ -287,7 +287,7 @@ Layout/AccessModifierIndentation: Layout/ArgumentAlignment: Description: Align the arguments of a method call if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: false + Enabled: true VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: with_fixed_indentation @@ -373,11 +373,11 @@ Layout/ClosingHeredocIndentation: VersionAdded: '0.57' Layout/ClosingParenthesisIndentation: Description: Checks the indentation of hanging closing parentheses. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/CommentIndentation: Description: Indentation of comments. - Enabled: false + Enabled: true AllowForAlignment: false VersionAdded: '0.49' VersionChanged: '1.24' @@ -385,12 +385,12 @@ Layout/ConditionPosition: Description: Checks for condition placed in a confusing position relative to the keyword. StyleGuide: "#same-line-condition" - Enabled: false + Enabled: true VersionAdded: '0.53' VersionChanged: '0.83' Layout/DefEndAlignment: Description: Align ends corresponding to defs correctly. - Enabled: false + Enabled: true VersionAdded: '0.53' EnforcedStyleAlignWith: start_of_line SupportedStylesAlignWith: @@ -400,7 +400,7 @@ Layout/DefEndAlignment: Layout/DotPosition: Description: Checks the position of the dot in multi-line method calls. StyleGuide: "#consistent-multi-line-chains" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: leading SupportedStyles: @@ -408,7 +408,7 @@ Layout/DotPosition: - trailing Layout/ElseAlignment: Description: Align elses and elsifs correctly. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/EmptyComment: Description: Checks empty comment. @@ -426,7 +426,7 @@ Layout/EmptyLineAfterGuardClause: Layout/EmptyLineAfterMagicComment: Description: Add an empty line after magic comments to separate them from code. StyleGuide: "#separate-magic-comments-from-code" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/EmptyLineAfterMultilineCondition: Description: Enforces empty line after multiline condition. @@ -437,7 +437,7 @@ Layout/EmptyLineAfterMultilineCondition: Layout/EmptyLineBetweenDefs: Description: Use empty lines between class/module/method defs. StyleGuide: "#empty-lines-between-methods" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '1.23' EmptyLineBetweenMethodDefs: true @@ -454,7 +454,7 @@ Layout/EmptyLines: Layout/EmptyLinesAroundAccessModifier: Description: Keep blank lines around access modifiers. StyleGuide: "#empty-lines-around-access-modifier" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: around SupportedStyles: @@ -464,12 +464,12 @@ Layout/EmptyLinesAroundAccessModifier: - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions Layout/EmptyLinesAroundArguments: Description: Keeps track of empty lines around method arguments. - Enabled: false + Enabled: true VersionAdded: '0.52' Layout/EmptyLinesAroundAttributeAccessor: Description: Keep blank lines around attribute accessors. StyleGuide: "#empty-lines-around-attribute-accessor" - Enabled: false + Enabled: true VersionAdded: '0.83' VersionChanged: '0.84' AllowAliasSyntax: true @@ -481,12 +481,12 @@ Layout/EmptyLinesAroundAttributeAccessor: Layout/EmptyLinesAroundBeginBody: Description: Keeps track of empty lines around begin-end bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/EmptyLinesAroundBlockBody: Description: Keeps track of empty lines around block bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: no_empty_lines SupportedStyles: @@ -495,7 +495,7 @@ Layout/EmptyLinesAroundBlockBody: Layout/EmptyLinesAroundClassBody: Description: Keeps track of empty lines around class bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '0.53' EnforcedStyle: no_empty_lines @@ -509,17 +509,17 @@ Layout/EmptyLinesAroundClassBody: Layout/EmptyLinesAroundExceptionHandlingKeywords: Description: Keeps track of empty lines around exception handling keywords. StyleGuide: "#empty-lines-around-bodies" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/EmptyLinesAroundMethodBody: Description: Keeps track of empty lines around method bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/EmptyLinesAroundModuleBody: Description: Keeps track of empty lines around module bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: no_empty_lines SupportedStyles: @@ -540,7 +540,7 @@ Layout/EndAlignment: Layout/EndOfLine: Description: Use Unix-style line endings. StyleGuide: "#crlf" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: native SupportedStyles: @@ -658,7 +658,7 @@ Layout/HeredocIndentation: Layout/IndentationConsistency: Description: Keep indentation straight. StyleGuide: "#spaces-indentation" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: normal SupportedStyles: @@ -669,7 +669,7 @@ Layout/IndentationConsistency: Layout/IndentationStyle: Description: Consistent indentation either with tabs only or spaces only. StyleGuide: "#spaces-indentation" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '0.82' IndentationWidth: @@ -680,19 +680,19 @@ Layout/IndentationStyle: Layout/IndentationWidth: Description: Use 2 spaces for indentation. StyleGuide: "#spaces-indentation" - Enabled: false + Enabled: true VersionAdded: '0.49' Width: 2 AllowedPatterns: [] Layout/InitialIndentation: Description: Checks the indentation of the first non-blank non-comment line in a file. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/LeadingCommentSpace: Description: Comments should start with a space. StyleGuide: "#hash-space" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '0.73' AllowDoxygenCommentStyle: false @@ -701,13 +701,13 @@ Layout/LeadingCommentSpace: AllowSteepAnnotation: false Layout/LeadingEmptyLines: Description: Check for unnecessary blank lines at the beginning of a file. - Enabled: false + Enabled: true VersionAdded: '0.57' VersionChanged: '0.77' Layout/LineContinuationLeadingSpace: Description: Use trailing spaces instead of leading spaces in strings broken over multiple lines (by a backslash). - Enabled: false + Enabled: true VersionAdded: '1.31' VersionChanged: '1.45' EnforcedStyle: trailing @@ -716,7 +716,7 @@ Layout/LineContinuationLeadingSpace: - trailing Layout/LineContinuationSpacing: Description: Checks the spacing in front of backslash in line continuations. - Enabled: false + Enabled: true VersionAdded: '1.31' EnforcedStyle: space SupportedStyles: @@ -783,7 +783,7 @@ Layout/MultilineAssignmentLayout: - new_line Layout/MultilineBlockLayout: Description: Ensures newlines after multiline block do statements. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/MultilineHashBraceLayout: Description: Checks that the closing brace in a hash literal is either on the same @@ -882,32 +882,32 @@ Layout/SingleLineBlockChain: Layout/SpaceAfterColon: Description: Use spaces after colons. StyleGuide: "#spaces-operators" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceAfterComma: Description: Use spaces after commas. StyleGuide: "#spaces-operators" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceAfterMethodName: Description: Do not put a space between a method name and the opening parenthesis in a method definition. StyleGuide: "#parens-no-spaces" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceAfterNot: Description: Tracks redundant space after the ! operator. StyleGuide: "#no-space-bang" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceAfterSemicolon: Description: Use spaces after semicolons. StyleGuide: "#spaces-operators" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceAroundBlockParameters: Description: Checks the spacing inside and after block parameters pipes. - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyleInsidePipes: no_space SupportedStylesInsidePipes: @@ -917,7 +917,7 @@ Layout/SpaceAroundEqualsInParameterDefault: Description: Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration. StyleGuide: "#spaces-around-equals" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -925,16 +925,16 @@ Layout/SpaceAroundEqualsInParameterDefault: - no_space Layout/SpaceAroundKeyword: Description: Use a space around keywords if appropriate. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceAroundMethodCallOperator: Description: Checks method call operators to not have spaces around them. - Enabled: false + Enabled: true VersionAdded: '0.82' Layout/SpaceAroundOperators: Description: Use a single space around operators. StyleGuide: "#spaces-operators" - Enabled: false + Enabled: true VersionAdded: '0.49' AllowForAlignment: true EnforcedStyleForExponentOperator: no_space @@ -947,7 +947,7 @@ Layout/SpaceAroundOperators: - no_space Layout/SpaceBeforeBlockBraces: Description: Checks that the left block brace has or doesn't have space before it. - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -961,29 +961,29 @@ Layout/SpaceBeforeBlockBraces: Layout/SpaceBeforeBrackets: Description: Checks for receiver with a space before the opening brackets. StyleGuide: "#space-in-brackets-access" - Enabled: false + Enabled: true VersionAdded: '1.7' Layout/SpaceBeforeComma: Description: No spaces before commas. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceBeforeComment: Description: Checks for missing space between code and a comment on the same line. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceBeforeFirstArg: Description: Checks that exactly one space is used between a method name and the first argument for method calls without parentheses. - Enabled: false + Enabled: true VersionAdded: '0.49' AllowForAlignment: true Layout/SpaceBeforeSemicolon: Description: No spaces before semicolons. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceInLambdaLiteral: Description: Checks for spaces in lambda literals. - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: require_no_space SupportedStyles: @@ -991,7 +991,7 @@ Layout/SpaceInLambdaLiteral: - require_space Layout/SpaceInsideArrayLiteralBrackets: Description: Checks the spacing inside array literal brackets. - Enabled: false + Enabled: true VersionAdded: '0.52' EnforcedStyle: no_space SupportedStyles: @@ -1004,13 +1004,13 @@ Layout/SpaceInsideArrayLiteralBrackets: - no_space Layout/SpaceInsideArrayPercentLiteral: Description: No unnecessary additional spaces between elements in %i/%w literals. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceInsideBlockBraces: Description: Checks that block braces have or don't have surrounding space. For blocks taking parameters, checks that the left brace has or doesn't have trailing space. - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -1024,7 +1024,7 @@ Layout/SpaceInsideBlockBraces: Layout/SpaceInsideHashLiteralBraces: Description: Use spaces inside hash literal braces - or don't. StyleGuide: "#spaces-braces" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -1038,7 +1038,7 @@ Layout/SpaceInsideHashLiteralBraces: Layout/SpaceInsideParens: Description: No spaces after ( or before ). StyleGuide: "#spaces-braces" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '1.22' EnforcedStyle: no_space @@ -1048,16 +1048,16 @@ Layout/SpaceInsideParens: - no_space Layout/SpaceInsidePercentLiteralDelimiters: Description: No unnecessary spaces inside delimiters of %i/%w/%x literals. - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceInsideRangeLiteral: Description: No spaces inside range literals. StyleGuide: "#no-space-inside-range-literals" - Enabled: false + Enabled: true VersionAdded: '0.49' Layout/SpaceInsideReferenceBrackets: Description: Checks the spacing inside referential brackets. - Enabled: false + Enabled: true VersionAdded: '0.52' VersionChanged: '0.53' EnforcedStyle: no_space @@ -1071,7 +1071,7 @@ Layout/SpaceInsideReferenceBrackets: Layout/SpaceInsideStringInterpolation: Description: Checks for padding/surrounding spaces inside string interpolation. StyleGuide: "#string-interpolation" - Enabled: false + Enabled: true VersionAdded: '0.49' EnforcedStyle: no_space SupportedStyles: @@ -1080,7 +1080,7 @@ Layout/SpaceInsideStringInterpolation: Layout/TrailingEmptyLines: Description: Checks trailing blank lines and final newline. StyleGuide: "#newline-eof" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: final_newline @@ -1090,7 +1090,7 @@ Layout/TrailingEmptyLines: Layout/TrailingWhitespace: Description: Avoid trailing whitespace. StyleGuide: "#no-trailing-whitespace" - Enabled: false + Enabled: true VersionAdded: '0.49' VersionChanged: '1.0' AllowInHeredoc: false From ae0c6e795c4713321e945d939831ecee5b679e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 19 Feb 2025 19:02:21 +0000 Subject: [PATCH 045/112] Update config --- rubocop.yml | 25 +++++++++++++++++++++++++ test/fixtures/full_config.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index 9cbf760c..e9b4c11c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -371,6 +371,11 @@ Lint/ConstantReassignment: Enabled: false <% end %> +<% if rubocop_version >= "1.72" %> +Lint/CopDirectiveSyntax: + Enabled: false +<% end %> + Lint/Debugger: Enabled: false @@ -608,6 +613,11 @@ Lint/RedundantSplatExpansion: Lint/RedundantStringCoercion: Enabled: false +<% if rubocop_version >= "1.72" %> +Lint/RedundantTypeConversion: + Enabled: false +<% end %> + Lint/RedundantWithIndex: Enabled: false @@ -676,6 +686,11 @@ Lint/StructNewOverride: Lint/SuppressedException: Enabled: false +<% if rubocop_version >= "1.72" %> +Lint/SuppressedExceptionInNumberConversion: + Enabled: false +<% end %> + Lint/SymbolConversion: Enabled: false @@ -735,6 +750,11 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Enabled: false +<% if rubocop_version >= "1.72" %> +Lint/UselessConstantScoping: + Enabled: false +<% end %> + <% if rubocop_version >= "1.69" %> Lint/UselessDefined: Enabled: false @@ -1451,6 +1471,11 @@ Style/RedundantFileExtensionInRequire: Style/RedundantFilterChain: Enabled: false +<% if rubocop_version >= "1.72" %> +Style/RedundantFormat: + Enabled: false +<% end %> + Style/RedundantFreeze: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 6b068660..f2ee3c41 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1187,6 +1187,10 @@ Lint/ConstantResolution: VersionAdded: '0.86' Only: [] Ignore: [] +Lint/CopDirectiveSyntax: + Description: Checks that `# rubocop:` directives are strictly formatted. + Enabled: false + VersionAdded: '1.72' Lint/Debugger: Description: Check for debugger calls. Enabled: false @@ -1681,6 +1685,10 @@ Lint/RedundantStringCoercion: Enabled: false VersionAdded: '0.19' VersionChanged: '0.77' +Lint/RedundantTypeConversion: + Description: Checks for redundantly converting a literal to the same type. + Enabled: false + VersionAdded: '1.72' Lint/RedundantWithIndex: Description: Checks for redundant `with_index`. Enabled: false @@ -1802,6 +1810,12 @@ Lint/SuppressedException: AllowNil: true VersionAdded: '0.9' VersionChanged: '1.12' +Lint/SuppressedExceptionInNumberConversion: + Description: Checks for cases where exceptions unrelated to the numeric constructors + may be unintentionally swallowed. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.72' Lint/SymbolConversion: Description: Checks for unnecessary symbol conversions. Enabled: false @@ -1935,6 +1949,10 @@ Lint/UselessAssignment: AutoCorrect: contextual VersionAdded: '0.11' VersionChanged: '1.66' +Lint/UselessConstantScoping: + Description: Checks for useless constant scoping. + Enabled: false + VersionAdded: '1.72' Lint/UselessDefined: Description: Checks for calls to `defined?` with strings and symbols. The result of such a call will always be truthy. @@ -2300,6 +2318,7 @@ Naming/PredicateName: MethodDefinitionMacros: - define_method - define_singleton_method + UseSorbetSigs: false Exclude: - "/spec/**/*" Naming/RescuedExceptionsVariableName: @@ -3904,6 +3923,13 @@ Style/RedundantFilterChain: SafeAutoCorrect: false VersionAdded: '1.52' VersionChanged: '1.57' +Style/RedundantFormat: + Description: Checks for usages of `Kernel#format` or `Kernel#sprintf` with only + a single argument. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.72' + VersionChanged: '1.72' Style/RedundantFreeze: Description: Checks usages of Object#freeze on immutable objects. Enabled: false From 6ca832384557ab7ca51167992be19b219d41d4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 19 Feb 2025 19:07:03 +0000 Subject: [PATCH 046/112] Upgrade Ruby version on config dump --- .github/workflows/dump-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index cee83c25..2f8db72d 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2.0' + ruby-version: '3.4.1' bundler-cache: true - name: Dump config From c164bc480f64b7557840ca2b7134a6862c9aeed3 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Wed, 19 Feb 2025 14:09:01 -0500 Subject: [PATCH 047/112] Allow RBS comments without a leading space Signed-off-by: Alexandre Terrasa --- rubocop.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index 5cfe5c34..c97f4982 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -110,6 +110,11 @@ Layout/HashAlignment: Layout/HeredocIndentation: Enabled: false +<% if rubocop_version >= "1.67" %> +Layout/LeadingCommentSpace: + AllowRBSInlineAnnotation: true +<% end %> + Layout/LineContinuationLeadingSpace: Enabled: true From d24b56e02375a77535e9e11cb370366f47c43c40 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:32:24 +0000 Subject: [PATCH 048/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index c23f53a4..8a3f7cc2 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -697,7 +697,7 @@ Layout/LeadingCommentSpace: VersionChanged: '0.73' AllowDoxygenCommentStyle: false AllowGemfileRubyComment: false - AllowRBSInlineAnnotation: false + AllowRBSInlineAnnotation: true AllowSteepAnnotation: false Layout/LeadingEmptyLines: Description: Check for unnecessary blank lines at the beginning of a file. From b683be5793fd775948a48bf2da3acaf5e3aade9b Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Fri, 21 Feb 2025 02:52:02 +0000 Subject: [PATCH 049/112] Unconditionally call `YAML.unsafe_load_file` Now that we require Ruby >= 3.1, we consistently have this method (as 3.1 includes Psych 4, and the method was introduced in 3.2.2). --- test/config_test.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/config_test.rb b/test/config_test.rb index 183fcad5..2dec1dfe 100644 --- a/test/config_test.rb +++ b/test/config_test.rb @@ -75,8 +75,7 @@ def test_config_is_sorted_alphabetically def test_no_cops_are_configured_as_pending pending_cops = [] - load_method = YAML.respond_to?(:unsafe_load_file) ? :unsafe_load_file : :load_file - YAML.public_send(load_method, FULL_CONFIG_PATH).each do |cop_name, cop_config| + YAML.unsafe_load_file(FULL_CONFIG_PATH).each do |cop_name, cop_config| pending_cops << cop_name if Hash === cop_config && cop_config["Enabled"] == "pending" end From 72da5fb5b1e3e575ce7725373915a5dfd41ccadc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:57:28 +0000 Subject: [PATCH 050/112] Bump rubocop from 1.72.2 to 1.73.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.72.2 to 1.73.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.72.2...v1.73.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 63869bc7..60de09ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,7 +31,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) - rubocop (1.72.2) + rubocop (1.73.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -42,7 +42,7 @@ GEM rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.0) + rubocop-ast (1.38.1) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) unicode-display_width (3.1.4) From bc5c1e68706dd20d1ac5cb9a52f4b84d034e511c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:57:59 +0000 Subject: [PATCH 051/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 335465f6..cf4bf211 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1489,6 +1489,7 @@ Lint/LambdaWithoutLiteralBlock: Lint/LiteralAsCondition: Description: Checks of literals used in conditions. Enabled: false + AutoCorrect: contextual VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: Description: Checks for literal assignments in the conditions. @@ -1658,9 +1659,8 @@ Lint/RedundantRegexpQuantifiers: Lint/RedundantRequireStatement: Description: Checks for unnecessary `require` statement. Enabled: false - SafeAutoCorrect: false VersionAdded: '0.76' - VersionChanged: '1.57' + VersionChanged: '1.73' Lint/RedundantSafeNavigation: Description: Checks for redundant safe navigation calls. Enabled: false @@ -2332,13 +2332,15 @@ Naming/VariableName: StyleGuide: "#snake-case-symbols-methods-vars" Enabled: false VersionAdded: '0.50' - VersionChanged: '1.8' + VersionChanged: '1.73' EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase AllowedIdentifiers: [] AllowedPatterns: [] + ForbiddenIdentifiers: [] + ForbiddenPatterns: [] Naming/VariableNumber: Description: Use the configured style when numbering symbols, methods and variables. StyleGuide: "#snake-case-symbols-methods-vars-with-numbers" @@ -2933,6 +2935,8 @@ Style/EndlessMethod: - allow_single_line - allow_always - disallow + - require_single_line + - require_always Style/EnvHome: Description: Checks for consistent usage of `ENV['HOME']`. Enabled: false @@ -3873,6 +3877,9 @@ Style/RedundantCondition: Description: Checks for unnecessary conditional expressions. Enabled: false VersionAdded: '0.76' + VersionChanged: '1.73' + AllowedMethods: + - nonzero? Style/RedundantConditional: Description: Don't return true/false from a conditional. Enabled: false @@ -4371,6 +4378,7 @@ Style/TrailingCommaInArrayLiteral: SupportedStylesForMultiline: - comma - consistent_comma + - diff_comma - no_comma Style/TrailingCommaInBlockArgs: Description: Checks for useless trailing commas in block arguments. @@ -4384,6 +4392,7 @@ Style/TrailingCommaInHashLiteral: SupportedStylesForMultiline: - comma - consistent_comma + - diff_comma - no_comma VersionAdded: '0.53' Style/TrailingMethodEndStatement: From 3dbbdfe9ec0afdb9dd4394636f43767de3f519a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 20 Feb 2025 20:48:03 +0000 Subject: [PATCH 052/112] Enable cops in the Lint Department The following Lint cops were enabled: * [Lint/AmbiguousAssignment](https://docs.rubocop.org/rubocop/cops_lint.html#lintambiguousassignment) * [Lint/AmbiguousOperator](https://docs.rubocop.org/rubocop/cops_lint.html#lintambiguousoperator) * [Lint/BigDecimalNew](https://docs.rubocop.org/rubocop/cops_lint.html#lintbigdecimalnew) * [Lint/BinaryOperatorWithIdenticalOperands](https://docs.rubocop.org/rubocop/cops_lint.html#lintbinaryoperatorwithidenticaloperands) * [Lint/CircularArgumentReference](https://docs.rubocop.org/rubocop/cops_lint.html#lintcircularargumentreference) * [Lint/ConstantOverwrittenInRescue](https://docs.rubocop.org/rubocop/cops_lint.html#lintconstantoverwritteninrescue) * [Lint/ConstantReassignment](https://docs.rubocop.org/rubocop/cops_lint.html#lintconstantreassignment) * [Lint/CopDirectiveSyntax](https://docs.rubocop.org/rubocop/cops_lint.html#lintcopdirectivesyntax) * [Lint/Debugger](https://docs.rubocop.org/rubocop/cops_lint.html#lintdebugger) * [Lint/DeprecatedClassMethods](https://docs.rubocop.org/rubocop/cops_lint.html#lintdeprecatedclassmethods) * [Lint/DeprecatedOpenSSLConstant](https://docs.rubocop.org/rubocop/cops_lint.html#lintdeprecatedopensslconstant) * [Lint/DisjunctiveAssignmentInConstructor](https://docs.rubocop.org/rubocop/cops_lint.html#lintdisjunctiveassignmentinconstructor) * [Lint/DuplicateCaseCondition](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicatecasecondition) * [Lint/DuplicateElsifCondition](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicateelsifcondition) * [Lint/DuplicateHashKey](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicatehashkey) * [Lint/DuplicateMagicComment](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicatemagiccomment) * [Lint/DuplicateMatchPattern](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicatematchpattern) * [Lint/DuplicateMethods](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicatemethods) * [Lint/DuplicateRegexpCharacterClassElement](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicateregexpcharacterclasselement) * [Lint/DuplicateRequire](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicaterequire) * [Lint/DuplicateRescueException](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicaterescueexception) * [Lint/DuplicateSetElement](https://docs.rubocop.org/rubocop/cops_lint.html#lintduplicatesetelement) * [Lint/EachWithObjectArgument](https://docs.rubocop.org/rubocop/cops_lint.html#linteachwithobjectargument) * [Lint/ElseLayout](https://docs.rubocop.org/rubocop/cops_lint.html#lintelselayout) * [Lint/EmptyEnsure](https://docs.rubocop.org/rubocop/cops_lint.html#lintemptyensure) * [Lint/EmptyExpression](https://docs.rubocop.org/rubocop/cops_lint.html#lintemptyexpression) * [Lint/EmptyInterpolation](https://docs.rubocop.org/rubocop/cops_lint.html#lintemptyinterpolation) * [Lint/EnsureReturn](https://docs.rubocop.org/rubocop/cops_lint.html#lintensurereturn) * [Lint/ImplicitStringConcatenation](https://docs.rubocop.org/rubocop/cops_lint.html#lintimplicitstringconcatenation) * [Lint/IneffectiveAccessModifier](https://docs.rubocop.org/rubocop/cops_lint.html#lintineffectiveaccessmodifier) * [Lint/InterpolationCheck](https://docs.rubocop.org/rubocop/cops_lint.html#lintinterpolationcheck) * [Lint/LiteralAsCondition](https://docs.rubocop.org/rubocop/cops_lint.html#lintliteralascondition) * [Lint/LiteralInInterpolation](https://docs.rubocop.org/rubocop/cops_lint.html#lintliteralininterpolation) * [Lint/MissingCopEnableDirective](https://docs.rubocop.org/rubocop/cops_lint.html#lintmissingcopenabledirective) * [Lint/MixedCaseRange](https://docs.rubocop.org/rubocop/cops_lint.html#lintmixedcaserange) * [Lint/MultipleComparison](https://docs.rubocop.org/rubocop/cops_lint.html#lintmultiplecomparison) * [Lint/NestedMethodDefinition](https://docs.rubocop.org/rubocop/cops_lint.html#lintnestedmethoddefinition) * [Lint/NestedPercentLiteral](https://docs.rubocop.org/rubocop/cops_lint.html#lintnestedpercentliteral) * [Lint/NextWithoutAccumulator](https://docs.rubocop.org/rubocop/cops_lint.html#lintnextwithoutaccumulator) * [Lint/NoReturnInBeginEndBlocks](https://docs.rubocop.org/rubocop/cops_lint.html#lintnoreturnInbeginendblocks) * [Lint/NumericOperationWithConstantResult](https://docs.rubocop.org/rubocop/cops_lint.html#lintnumericoperationwithconstantresult) * [Lint/OrAssignmentToConstant](https://docs.rubocop.org/rubocop/cops_lint.html#lintoreassignmenttoconstant) * [Lint/ParenthesesAsGroupedExpression](https://docs.rubocop.org/rubocop/cops_lint.html#lintparenthesesasgroupedexpression) * [Lint/RedundantCopDisableDirective](https://docs.rubocop.org/rubocop/cops_lint.html#lintredundantcopdisabledirective) * [Lint/RedundantCopEnableDirective](https://docs.rubocop.org/rubocop/cops_lint.html#lintredundantcopenabledirective) * [Lint/RedundantStringCoercion](https://docs.rubocop.org/rubocop/cops_lint.html#lintredundantstringcoercion) * [Lint/RedundantWithIndex](https://docs.rubocop.org/rubocop/cops_lint.html#lintredundantwithindex) * [Lint/RedundantWithObject](https://docs.rubocop.org/rubocop/cops_lint.html#lintredundantwithobject) * [Lint/RegexpAsCondition](https://docs.rubocop.org/rubocop/cops_lint.html#lintregexpascondition) * [Lint/ReturnInVoidContext](https://docs.rubocop.org/rubocop/cops_lint.html#lintreturninvoidcontext) * [Lint/SelfAssignment](https://docs.rubocop.org/rubocop/cops_lint.html#lintselfassignment) * [Lint/SendWithMixinArgument](https://docs.rubocop.org/rubocop/cops_lint.html#lintsendwithmixinargument) * [Lint/TripleQuotes](https://docs.rubocop.org/rubocop/cops_lint.html#linttriplequotes) --- rubocop.yml | 149 +++------------------------------- test/fixtures/full_config.yml | 108 ++++++++++++------------ 2 files changed, 67 insertions(+), 190 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 61c5305f..df4bd8b8 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -168,14 +168,11 @@ Layout/SpaceBeforeBrackets: # Lint Department Lint/AmbiguousAssignment: - Enabled: false + Enabled: true Lint/AmbiguousBlockAssociation: Enabled: false -Lint/AmbiguousOperator: - Enabled: false - Lint/AmbiguousOperatorPrecedence: Enabled: false @@ -193,90 +190,45 @@ Lint/ArrayLiteralInRegexp: Lint/AssignmentInCondition: Enabled: false -Lint/BigDecimalNew: - Enabled: false - -Lint/BinaryOperatorWithIdenticalOperands: - Enabled: false - Lint/BooleanSymbol: Enabled: false -Lint/CircularArgumentReference: - Enabled: false - Lint/ConstantDefinitionInBlock: Enabled: false Lint/ConstantOverwrittenInRescue: - Enabled: false + Enabled: true <% if rubocop_version >= "1.70" %> Lint/ConstantReassignment: - Enabled: false + Enabled: true <% end %> <% if rubocop_version >= "1.72" %> Lint/CopDirectiveSyntax: - Enabled: false + Enabled: true <% end %> -Lint/Debugger: - Enabled: false - -Lint/DeprecatedClassMethods: - Enabled: false - Lint/DeprecatedConstants: Enabled: false -Lint/DeprecatedOpenSSLConstant: - Enabled: false - -Lint/DisjunctiveAssignmentInConstructor: - Enabled: false - Lint/DuplicateBranch: Enabled: false -Lint/DuplicateCaseCondition: - Enabled: false - -Lint/DuplicateElsifCondition: - Enabled: false - -Lint/DuplicateHashKey: - Enabled: false - Lint/DuplicateMagicComment: - Enabled: false + Enabled: true Lint/DuplicateMatchPattern: - Enabled: false - -Lint/DuplicateMethods: - Enabled: false + Enabled: true Lint/DuplicateRegexpCharacterClassElement: - Enabled: false - -Lint/DuplicateRequire: - Enabled: false - -Lint/DuplicateRescueException: - Enabled: false + Enabled: true <% if rubocop_version >= "1.67" %> Lint/DuplicateSetElement: - Enabled: false + Enabled: true <% end %> -Lint/EachWithObjectArgument: - Enabled: false - -Lint/ElseLayout: - Enabled: false - Lint/EmptyBlock: Enabled: false @@ -286,27 +238,15 @@ Lint/EmptyClass: Lint/EmptyConditionalBody: Enabled: false -Lint/EmptyEnsure: - Enabled: false - -Lint/EmptyExpression: - Enabled: false - Lint/EmptyFile: Enabled: false Lint/EmptyInPattern: Enabled: false -Lint/EmptyInterpolation: - Enabled: false - Lint/EmptyWhen: Enabled: false -Lint/EnsureReturn: - Enabled: false - Lint/ErbNewArguments: Enabled: false @@ -333,65 +273,35 @@ Lint/HashNewWithKeywordArgumentsAsDefault: Lint/IdentityComparison: Enabled: false -Lint/ImplicitStringConcatenation: - Enabled: false - Lint/IncompatibleIoSelectWithFiberScheduler: Enabled: false -Lint/IneffectiveAccessModifier: - Enabled: false - Lint/InheritException: Enabled: false -Lint/InterpolationCheck: - Enabled: false - Lint/ItWithoutArgumentsInBlock: Enabled: false Lint/LambdaWithoutLiteralBlock: Enabled: false -Lint/LiteralAsCondition: - Enabled: false - Lint/LiteralAssignmentInCondition: Enabled: false -Lint/LiteralInInterpolation: - Enabled: false - Lint/Loop: Enabled: false -Lint/MissingCopEnableDirective: - Enabled: false - Lint/MissingSuper: Enabled: false Lint/MixedCaseRange: - Enabled: false + Enabled: true Lint/MixedRegexpCaptureTypes: Enabled: false -Lint/MultipleComparison: - Enabled: false - -Lint/NestedMethodDefinition: - Enabled: false - -Lint/NestedPercentLiteral: - Enabled: false - -Lint/NextWithoutAccumulator: - Enabled: false - Lint/NoReturnInBeginEndBlocks: - Enabled: false + Enabled: true Lint/NonAtomicFileOperation: Enabled: false @@ -407,11 +317,11 @@ Lint/NumberedParameterAssignment: <% if rubocop_version >= "1.69" %> Lint/NumericOperationWithConstantResult: - Enabled: false + Enabled: true <% end %> Lint/OrAssignmentToConstant: - Enabled: false + Enabled: true Lint/OrderedMagicComments: Enabled: false @@ -419,9 +329,6 @@ Lint/OrderedMagicComments: Lint/OutOfRangeRegexpRef: Enabled: false -Lint/ParenthesesAsGroupedExpression: - Enabled: false - Lint/PercentStringArray: Enabled: false @@ -434,12 +341,6 @@ Lint/RaiseException: Lint/RandOne: Enabled: false -Lint/RedundantCopDisableDirective: - Enabled: false - -Lint/RedundantCopEnableDirective: - Enabled: false - Lint/RedundantDirGlobSort: Enabled: false @@ -455,26 +356,14 @@ Lint/RedundantSafeNavigation: Lint/RedundantSplatExpansion: Enabled: false -Lint/RedundantStringCoercion: - Enabled: false - <% if rubocop_version >= "1.72" %> Lint/RedundantTypeConversion: Enabled: false <% end %> -Lint/RedundantWithIndex: - Enabled: false - -Lint/RedundantWithObject: - Enabled: false - Lint/RefinementImportMethods: Enabled: false -Lint/RegexpAsCondition: - Enabled: false - Lint/RequireParentheses: Enabled: false @@ -490,9 +379,6 @@ Lint/RescueException: Lint/RescueType: Enabled: false -Lint/ReturnInVoidContext: - Enabled: false - Lint/SafeNavigationChain: Enabled: false @@ -505,12 +391,6 @@ Lint/SafeNavigationWithEmpty: Lint/ScriptPermission: Enabled: false -Lint/SelfAssignment: - Enabled: false - -Lint/SendWithMixinArgument: - Enabled: false - Lint/ShadowedArgument: Enabled: false @@ -548,11 +428,8 @@ Lint/ToJSON: Lint/TopLevelReturnWithArgument: Enabled: false -Lint/TrailingCommaInAttributeDeclaration: - Enabled: false - Lint/TripleQuotes: - Enabled: false + Enabled: true Lint/UnderscorePrefixedVariableName: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index cf4bf211..16be6439 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1096,7 +1096,7 @@ Layout/TrailingWhitespace: AllowInHeredoc: false Lint/AmbiguousAssignment: Description: Checks for mistyped shorthand assignments. - Enabled: false + Enabled: true VersionAdded: '1.7' Lint/AmbiguousBlockAssociation: Description: Checks for ambiguous block association with method when param passed @@ -1110,7 +1110,7 @@ Lint/AmbiguousOperator: Description: Checks for ambiguous operators in the first argument of a method invocation without parentheses. StyleGuide: "#method-invocation-parens" - Enabled: false + Enabled: true VersionAdded: '0.17' VersionChanged: '0.83' Lint/AmbiguousOperatorPrecedence: @@ -1145,11 +1145,11 @@ Lint/AssignmentInCondition: AllowSafeAssignment: true Lint/BigDecimalNew: Description: "`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead." - Enabled: false + Enabled: true VersionAdded: '0.53' Lint/BinaryOperatorWithIdenticalOperands: Description: Checks for places where binary operator has identical operands. - Enabled: false + Enabled: true Safe: false VersionAdded: '0.89' VersionChanged: '1.69' @@ -1162,7 +1162,7 @@ Lint/BooleanSymbol: Lint/CircularArgumentReference: Description: Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument. - Enabled: false + Enabled: true VersionAdded: '0.33' Lint/ConstantDefinitionInBlock: Description: Do not define constants within a block. @@ -1175,11 +1175,11 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Description: Checks for overwriting an exception with an exception result by use `rescue =>`. - Enabled: false + Enabled: true VersionAdded: '1.31' Lint/ConstantReassignment: Description: Checks for constant reassignments. - Enabled: false + Enabled: true VersionAdded: '1.70' Lint/ConstantResolution: Description: Check that constants are fully qualified with `::`. @@ -1189,11 +1189,11 @@ Lint/ConstantResolution: Ignore: [] Lint/CopDirectiveSyntax: Description: Checks that `# rubocop:` directives are strictly formatted. - Enabled: false + Enabled: true VersionAdded: '1.72' Lint/Debugger: Description: Check for debugger calls. - Enabled: false + Enabled: true VersionAdded: '0.14' VersionChanged: '1.63' DebuggerMethods: @@ -1241,7 +1241,7 @@ Lint/Debugger: - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. - Enabled: false + Enabled: true VersionAdded: '0.19' Lint/DeprecatedConstants: Description: Checks for deprecated constants. @@ -1272,11 +1272,11 @@ Lint/DeprecatedConstants: DeprecatedVersion: '3.0' Lint/DeprecatedOpenSSLConstant: Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`. - Enabled: false + Enabled: true VersionAdded: '0.84' Lint/DisjunctiveAssignmentInConstructor: Description: In constructor, plain assignment is preferred over disjunctive. - Enabled: false + Enabled: true Safe: false VersionAdded: '0.62' VersionChanged: '0.88' @@ -1291,54 +1291,54 @@ Lint/DuplicateBranch: IgnoreDuplicateElseBranch: false Lint/DuplicateCaseCondition: Description: Do not repeat values in case conditionals. - Enabled: false + Enabled: true VersionAdded: '0.45' Lint/DuplicateElsifCondition: Description: Do not repeat conditions used in if `elsif`. - Enabled: false + Enabled: true VersionAdded: '0.88' Lint/DuplicateHashKey: Description: Check for duplicate keys in hash literals. - Enabled: false + Enabled: true VersionAdded: '0.34' VersionChanged: '0.77' Lint/DuplicateMagicComment: Description: Check for duplicated magic comments. - Enabled: false + Enabled: true VersionAdded: '1.37' Lint/DuplicateMatchPattern: Description: Do not repeat patterns in `in` keywords. - Enabled: false + Enabled: true VersionAdded: '1.50' Lint/DuplicateMethods: Description: Check for duplicate method definitions. - Enabled: false + Enabled: true VersionAdded: '0.29' Lint/DuplicateRegexpCharacterClassElement: Description: Checks for duplicate elements in Regexp character classes. - Enabled: false + Enabled: true VersionAdded: '1.1' Lint/DuplicateRequire: Description: Check for duplicate `require`s and `require_relative`s. - Enabled: false + Enabled: true SafeAutoCorrect: false VersionAdded: '0.90' VersionChanged: '1.28' Lint/DuplicateRescueException: Description: Checks that there are no repeated exceptions used in `rescue` expressions. - Enabled: false + Enabled: true VersionAdded: '0.89' Lint/DuplicateSetElement: Description: Checks for duplicate elements in Set. - Enabled: false + Enabled: true VersionAdded: '1.67' Lint/EachWithObjectArgument: Description: Check for immutable argument given to each_with_object. - Enabled: false + Enabled: true VersionAdded: '0.31' Lint/ElseLayout: Description: Check for odd code arrangement in an else block. - Enabled: false + Enabled: true VersionAdded: '0.17' VersionChanged: '1.2' Lint/EmptyBlock: @@ -1364,13 +1364,13 @@ Lint/EmptyConditionalBody: VersionChanged: '1.61' Lint/EmptyEnsure: Description: Checks for empty ensure block. - Enabled: false + Enabled: true AutoCorrect: contextual VersionAdded: '0.10' VersionChanged: '1.61' Lint/EmptyExpression: Description: Checks for empty expressions. - Enabled: false + Enabled: true VersionAdded: '0.45' Lint/EmptyFile: Description: Enforces that Ruby source files are not empty. @@ -1384,7 +1384,7 @@ Lint/EmptyInPattern: VersionAdded: '1.16' Lint/EmptyInterpolation: Description: Checks for empty string interpolation. - Enabled: false + Enabled: true AutoCorrect: contextual VersionAdded: '0.20' VersionChanged: '1.61' @@ -1397,7 +1397,7 @@ Lint/EmptyWhen: Lint/EnsureReturn: Description: Do not use return in an ensure block. StyleGuide: "#no-return-ensure" - Enabled: false + Enabled: true VersionAdded: '0.9' VersionChanged: '0.83' Lint/ErbNewArguments: @@ -1448,7 +1448,7 @@ Lint/IdentityComparison: Lint/ImplicitStringConcatenation: Description: Checks for adjacent string literals on the same line, which could better be represented as a single string literal. - Enabled: false + Enabled: true VersionAdded: '0.36' Lint/IncompatibleIoSelectWithFiberScheduler: Description: Checks for `IO.select` that is incompatible with Fiber Scheduler. @@ -1459,7 +1459,7 @@ Lint/IncompatibleIoSelectWithFiberScheduler: Lint/IneffectiveAccessModifier: Description: Checks for attempts to use `private` or `protected` to set the visibility of a class method, which does not work. - Enabled: false + Enabled: true VersionAdded: '0.36' Lint/InheritException: Description: Avoid inheriting from the `Exception` class. @@ -1473,7 +1473,7 @@ Lint/InheritException: - runtime_error Lint/InterpolationCheck: Description: Checks for interpolation in a single quoted string. - Enabled: false + Enabled: true SafeAutoCorrect: false VersionAdded: '0.50' VersionChanged: '1.40' @@ -1488,7 +1488,7 @@ Lint/LambdaWithoutLiteralBlock: VersionAdded: '1.8' Lint/LiteralAsCondition: Description: Checks of literals used in conditions. - Enabled: false + Enabled: true AutoCorrect: contextual VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: @@ -1497,7 +1497,7 @@ Lint/LiteralAssignmentInCondition: VersionAdded: '1.58' Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. - Enabled: false + Enabled: true VersionAdded: '0.19' VersionChanged: '0.32' Lint/Loop: @@ -1510,7 +1510,7 @@ Lint/Loop: Safe: false Lint/MissingCopEnableDirective: Description: Checks for a `# rubocop:enable` after `# rubocop:disable`. - Enabled: false + Enabled: true VersionAdded: '0.52' MaximumRangeSize: .inf Lint/MissingSuper: @@ -1523,7 +1523,7 @@ Lint/MissingSuper: Lint/MixedCaseRange: Description: Checks for mixed-case character ranges since they include likely unintended characters. - Enabled: false + Enabled: true SafeAutoCorrect: false VersionAdded: '1.53' Lint/MixedRegexpCaptureTypes: @@ -1532,28 +1532,28 @@ Lint/MixedRegexpCaptureTypes: VersionAdded: '0.85' Lint/MultipleComparison: Description: Use `&&` operator to compare multiple values. - Enabled: false + Enabled: true VersionAdded: '0.47' VersionChanged: '1.1' Lint/NestedMethodDefinition: Description: Do not use nested method definitions. StyleGuide: "#no-nested-methods" - Enabled: false + Enabled: true AllowedMethods: [] AllowedPatterns: [] VersionAdded: '0.32' Lint/NestedPercentLiteral: Description: Checks for nested percent literals. - Enabled: false + Enabled: true VersionAdded: '0.52' Lint/NextWithoutAccumulator: Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block. - Enabled: false + Enabled: true VersionAdded: '0.36' Lint/NoReturnInBeginEndBlocks: Description: Do not `return` inside `begin..end` blocks in assignment contexts. - Enabled: false + Enabled: true VersionAdded: '1.2' Lint/NonAtomicFileOperation: Description: Checks for non-atomic file operations. @@ -1587,11 +1587,11 @@ Lint/NumberedParameterAssignment: VersionAdded: '1.9' Lint/NumericOperationWithConstantResult: Description: Checks for numeric operations with constant results. - Enabled: false + Enabled: true VersionAdded: '1.69' Lint/OrAssignmentToConstant: Description: Checks unintended or-assignment to constant. - Enabled: false + Enabled: true Safe: false VersionAdded: '1.9' Lint/OrderedMagicComments: @@ -1610,7 +1610,7 @@ Lint/OutOfRangeRegexpRef: Lint/ParenthesesAsGroupedExpression: Description: Checks for method calls with a space before the opening parenthesis. StyleGuide: "#parens-no-spaces" - Enabled: false + Enabled: true VersionAdded: '0.12' VersionChanged: '0.83' Lint/PercentStringArray: @@ -1640,11 +1640,11 @@ Lint/RandOne: Lint/RedundantCopDisableDirective: Description: 'Checks for rubocop:disable comments that can be removed. Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.' - Enabled: false + Enabled: true VersionAdded: '0.76' Lint/RedundantCopEnableDirective: Description: Checks for rubocop:enable comments that can be removed. - Enabled: false + Enabled: true VersionAdded: '0.76' Lint/RedundantDirGlobSort: Description: Checks for redundant `sort` method to `Dir.glob` and `Dir[]`. @@ -1682,7 +1682,7 @@ Lint/RedundantSplatExpansion: Lint/RedundantStringCoercion: Description: Checks for Object#to_s usage in string interpolation. StyleGuide: "#no-to-s" - Enabled: false + Enabled: true VersionAdded: '0.19' VersionChanged: '0.77' Lint/RedundantTypeConversion: @@ -1691,11 +1691,11 @@ Lint/RedundantTypeConversion: VersionAdded: '1.72' Lint/RedundantWithIndex: Description: Checks for redundant `with_index`. - Enabled: false + Enabled: true VersionAdded: '0.50' Lint/RedundantWithObject: Description: Checks for redundant `with_object`. - Enabled: false + Enabled: true VersionAdded: '0.51' Lint/RefinementImportMethods: Description: Use `Refinement#import_methods` when using `include` or `prepend` in @@ -1706,7 +1706,7 @@ Lint/RefinementImportMethods: Lint/RegexpAsCondition: Description: Do not use regexp literal as a condition. The regexp literal matches `$_` implicitly. - Enabled: false + Enabled: true VersionAdded: '0.51' VersionChanged: '0.86' Lint/RequireParentheses: @@ -1734,7 +1734,7 @@ Lint/RescueType: VersionAdded: '0.49' Lint/ReturnInVoidContext: Description: Checks for return in void context. - Enabled: false + Enabled: true VersionAdded: '0.50' Lint/SafeNavigationChain: Description: Do not chain ordinary method call after safe navigation operator. @@ -1773,11 +1773,11 @@ Lint/ScriptPermission: VersionChanged: '0.50' Lint/SelfAssignment: Description: Checks for self-assignments. - Enabled: false + Enabled: true VersionAdded: '0.89' Lint/SendWithMixinArgument: Description: Checks for `send` method when using mixin. - Enabled: false + Enabled: true VersionAdded: '0.75' Lint/ShadowedArgument: Description: Avoid reassigning arguments before they were used. @@ -1846,13 +1846,13 @@ Lint/TopLevelReturnWithArgument: - "/**/*.jb" Lint/TrailingCommaInAttributeDeclaration: Description: Checks for trailing commas in attribute declarations. - Enabled: false + Enabled: true AutoCorrect: contextual VersionAdded: '0.90' VersionChanged: '1.61' Lint/TripleQuotes: Description: Checks for useless triple quote constructs. - Enabled: false + Enabled: true VersionAdded: '1.9' Lint/UnderscorePrefixedVariableName: Description: Do not use prefix `_` for a variable that is used. From 84e0701ef8fa4bc6e1b72de3b9cd25f5457a57b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 28 Feb 2025 17:27:06 +0000 Subject: [PATCH 053/112] Add Lint/NoReturnInMemoization cop This cop checks for the use of `return` with a value in `begin..end` blocks in the context of instance variable assignment such as memoization. Using `return` with a value in these blocks can lead to unexpected behavior as the `return` will exit the method and not set the value of the instance variable. --- Gemfile | 1 + Gemfile.lock | 5 + lib/rubocop-shopify.rb | 3 + .../cop/lint/no_return_in_memoization.rb | 98 +++++++++ .../cop/lint/no_return_in_memoization_test.rb | 187 ++++++++++++++++++ test/test_helper.rb | 2 + 6 files changed, 296 insertions(+) create mode 100644 lib/rubocop-shopify.rb create mode 100644 lib/rubocop/cop/lint/no_return_in_memoization.rb create mode 100644 test/rubocop/cop/lint/no_return_in_memoization_test.rb diff --git a/Gemfile b/Gemfile index eabaf160..2ef93698 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,7 @@ gem "diffy" gem "minitest" gem "pry-byebug" gem "rake" +gem "rubocop-minitest" # Fixes the following warning on Ruby 3.3: # base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. diff --git a/Gemfile.lock b/Gemfile.lock index 60de09ac..fe2bce34 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,6 +44,10 @@ GEM unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.38.1) parser (>= 3.3.1.0) + rubocop-minitest (0.37.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (1.13.0) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) @@ -58,6 +62,7 @@ DEPENDENCIES minitest pry-byebug rake + rubocop-minitest rubocop-shopify! BUNDLED WITH diff --git a/lib/rubocop-shopify.rb b/lib/rubocop-shopify.rb new file mode 100644 index 00000000..496ac191 --- /dev/null +++ b/lib/rubocop-shopify.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require "rubocop/cop/lint/no_return_in_memoization" diff --git a/lib/rubocop/cop/lint/no_return_in_memoization.rb b/lib/rubocop/cop/lint/no_return_in_memoization.rb new file mode 100644 index 00000000..61eff5c1 --- /dev/null +++ b/lib/rubocop/cop/lint/no_return_in_memoization.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +require "rubocop" + +module RuboCop + module Cop + module Lint + # Checks for the use of a `return` with a value in `begin..end` blocks + # in the context of instance variable assignment such as memoization. + # Using `return` with a value in these blocks can lead to unexpected behavior + # as the `return` will exit the method that contains and not set the values + # of the instance variable. + # + # @example + # + # # bad + # def foo + # @foo ||= begin + # return 1 if bar + # 2 + # end + # end + # + # # bad + # def foo + # @foo = begin + # return 1 if bar + # 2 + # end + # end + # + # # bad + # def foo + # @foo += begin + # return 1 if bar + # 2 + # end + # end + # + # # bad - using return in rescue blocks still exits the method + # def foo + # @foo ||= begin + # bar + # rescue + # return 2 if baz + # end + # end + # + # # good + # def foo + # @foo ||= begin + # if bar + # 1 + # else + # 2 + # end + # end + # end + # + # # good - not an assignment to an instance variable + # def foo + # foo = begin + # return 1 if bar + # 2 + # end + # end + # + # # good - proper exception handling without return + # def foo + # @foo ||= begin + # bar + # rescue + # baz ? 2 : 3 + # end + # end + class NoReturnInMemoization < ::RuboCop::Cop::Base + MSG = 'Do not `return` in `begin..end` blocks in instance variable assignment contexts.' + + def on_or_asgn(node) + node.each_node(:kwbegin) do |kwbegin_node| + kwbegin_node.each_node(:return) do |return_node| + add_offense(return_node) + end + end + end + + def on_op_asgn(node) + return unless node.assignment_node.ivasgn_type? + + on_or_asgn(node) + end + + alias on_ivasgn on_or_asgn + alias on_and_asgn on_or_asgn + end + end + end +end diff --git a/test/rubocop/cop/lint/no_return_in_memoization_test.rb b/test/rubocop/cop/lint/no_return_in_memoization_test.rb new file mode 100644 index 00000000..5b87b434 --- /dev/null +++ b/test/rubocop/cop/lint/no_return_in_memoization_test.rb @@ -0,0 +1,187 @@ +# frozen_string_literal: true + +require "test_helper" +require "rubocop/minitest/assert_offense" + +module RuboCop + module Cop + module Lint + class NoReturnInMemoizationTest < ::Minitest::Test + include ::RuboCop::Minitest::AssertOffense + + def setup + @cop = NoReturnInMemoization.new + end + + def test_returns_in_memoization_are_offenses + assert_offense(<<~RUBY) + def foo + @foo ||= begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + end + + def test_returns_in_regular_assignment_are_not_offenses + assert_no_offenses(<<~RUBY) + def foo + foo = begin + return 1 if bar + 2 + end + end + RUBY + end + + def test_returns_in_regular_assignment_for_instance_variable_are_offenses + assert_offense(<<~RUBY) + def foo + @foo = begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + end + + def test_returns_in_operation_assignment_for_instance_variable_are_offenses + assert_offense(<<~RUBY) + def foo + @foo += begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + + assert_offense(<<~RUBY) + def foo + @foo -= begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + + assert_offense(<<~RUBY) + def foo + @foo *= begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + + assert_offense(<<~RUBY) + def foo + @foo /= begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + + assert_offense(<<~RUBY) + def foo + @foo **= begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + + assert_offense(<<~RUBY) + def foo + @foo &&= begin + return 1 if bar + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + 2 + end + end + RUBY + end + + def test_returns_in_operation_assignment_for_instance_variable_are_not_offenses + assert_no_offenses(<<~RUBY) + def foo + foo += begin + return 1 if bar + 2 + end + end + RUBY + + assert_no_offenses(<<~RUBY) + def foo + foo -= begin + return 1 if bar + 2 + end + end + RUBY + + assert_no_offenses(<<~RUBY) + def foo + foo *= begin + return 1 if bar + 2 + end + end + RUBY + + assert_no_offenses(<<~RUBY) + def foo + foo /= begin + return 1 if bar + 2 + end + end + RUBY + + assert_no_offenses(<<~RUBY) + def foo + foo **= begin + return 1 if bar + 2 + end + end + RUBY + end + + def test_returns_in_assignment_for_exception_handling_are_not_offenses + assert_no_offenses(<<~RUBY) + def foo + foo += begin + bar + rescue + return 2 if baz + end + end + RUBY + end + + def test_returns_in_memoization_rescue_blocks_are_offenses + assert_offense(<<~RUBY) + def foo + @foo ||= begin + bar + rescue + return 2 if baz + ^^^^^^^^ Lint/NoReturnInMemoization: Do not `return` in `begin..end` blocks in instance variable assignment contexts. + end + end + RUBY + end + end + end + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index dbb37cfb..022440e8 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,6 +3,8 @@ require "minitest/autorun" require "pry-byebug" +require "rubocop-shopify" + module Warning class << self def warn(message) From 1d9bb8ecd6cdcd06157be88c75c3110d83117278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 3 Mar 2025 21:46:25 +0000 Subject: [PATCH 054/112] Make rubocop-shopify a rubocop plugin --- Gemfile.lock | 3 ++- config/default.yml | 4 ++++ lib/rubocop-shopify.rb | 3 +++ lib/rubocop/shopify/plugin.rb | 30 ++++++++++++++++++++++++++++++ lib/rubocop/shopify/version.rb | 7 +++++++ rubocop-shopify.gemspec | 13 ++++++++++--- rubocop.yml | 3 +++ test/fixtures/full_config.yml | 5 +++++ 8 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 config/default.yml create mode 100644 lib/rubocop/shopify/plugin.rb create mode 100644 lib/rubocop/shopify/version.rb diff --git a/Gemfile.lock b/Gemfile.lock index fe2bce34..b70104d7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,8 @@ PATH remote: . specs: rubocop-shopify (2.15.1) - rubocop (~> 1.62) + lint_roller + rubocop (~> 1.72) GEM remote: https://rubygems.org/ diff --git a/config/default.yml b/config/default.yml new file mode 100644 index 00000000..c9b8d30d --- /dev/null +++ b/config/default.yml @@ -0,0 +1,4 @@ +Lint/NoReturnInMemoization: + Enabled: true + VersionAdded: "3.0.0" + Description: "Checks for the use of a `return` with a value in `begin..end` blocks in the context of instance variable assignment such as memoization." diff --git a/lib/rubocop-shopify.rb b/lib/rubocop-shopify.rb index 496ac191..95baaa34 100644 --- a/lib/rubocop-shopify.rb +++ b/lib/rubocop-shopify.rb @@ -1,3 +1,6 @@ # frozen_string_literal: true +require "rubocop/shopify/version" +require "rubocop/shopify/plugin" + require "rubocop/cop/lint/no_return_in_memoization" diff --git a/lib/rubocop/shopify/plugin.rb b/lib/rubocop/shopify/plugin.rb new file mode 100644 index 00000000..55f269b6 --- /dev/null +++ b/lib/rubocop/shopify/plugin.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require "lint_roller" + +module RuboCop + module Shopify + class Plugin < LintRoller::Plugin + def about + LintRoller::About.new( + name: "rubocop-shopify", + version: RuboCop::Shopify::VERSION, + homepage: "https://github.com/Shopify/rubocop-shopify", + description: "A plugin for RuboCop to enforce Shopify-specific coding standards." + ) + end + + def supported?(context) + context.engine == :rubocop + end + + def rules(context) + LintRoller::Rules.new( + type: :path, + config_format: :rubocop, + value: File.expand_path("../../../config/default.yml", __dir__) + ) + end + end + end +end diff --git a/lib/rubocop/shopify/version.rb b/lib/rubocop/shopify/version.rb new file mode 100644 index 00000000..3d3b8402 --- /dev/null +++ b/lib/rubocop/shopify/version.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module RuboCop + module Shopify + VERSION = "2.15.1" + end +end diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index dcd0d18b..c3cef5e3 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -1,9 +1,14 @@ # frozen_string_literal: true +lib = File.expand_path("../lib", __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) + +require "rubocop/shopify/version" + Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "rubocop-shopify" - s.version = "2.15.1" + s.version = RuboCop::Shopify::VERSION s.summary = "Shopify's style guide for Ruby." s.description = "Gem containing the rubocop.yml config that corresponds to " \ "the implementation of the Shopify's style guide for Ruby." @@ -14,14 +19,16 @@ Gem::Specification.new do |s| s.email = "gems@shopify.com" s.homepage = "https://shopify.github.io/ruby-style-guide/" - s.files = Dir["rubocop*.yml", "lib/**/*", "LICENSE.md", "README.md"] + s.files = Dir["rubocop*.yml", "lib/**/*", "LICENSE.md", "config/default.yml", "README.md"] s.metadata = { "source_code_uri" => "https://github.com/Shopify/ruby-style-guide/tree/v#{s.version}", "allowed_push_host" => "https://rubygems.org", + "default_lint_roller_plugin" => "RuboCop::Shopify::Plugin" } s.required_ruby_version = ">= 3.1.0" - s.add_dependency("rubocop", "~> 1.62") + s.add_dependency("rubocop", "~> 1.72") + s.add_dependency("lint_roller") end diff --git a/rubocop.yml b/rubocop.yml index df4bd8b8..a0154475 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -4,6 +4,9 @@ rubocop_version = Gem.loaded_specs.fetch("rubocop").version %> +plugins: + - rubocop-shopify + inherit_mode: merge: - Exclude diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 16be6439..2282967f 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -4523,6 +4523,11 @@ Style/ZeroLengthPredicate: Safe: false VersionAdded: '0.37' VersionChanged: '0.39' +Lint/NoReturnInMemoization: + Enabled: true + VersionAdded: 3.0.0 + Description: Checks for the use of a `return` with a value in `begin..end` blocks + in the context of instance variable assignment such as memoization. inherit_mode: merge: - Exclude From 573df7fd165503d062a7cf051052325bff7c32c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 3 Mar 2025 21:54:18 +0000 Subject: [PATCH 055/112] Remove version checks from rubocop.yml We only support Rubocop 1.72. --- rubocop.yml | 63 ----------------------------------------------------- 1 file changed, 63 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index a0154475..6b0adb9e 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -22,10 +22,8 @@ Bundler/OrderedGems: # Gemspec Department -<% if rubocop_version >= "1.65" %> Gemspec/AddRuntimeDependency: Enabled: false -<% end %> Gemspec/DeprecatedAttributeAssignment: Enabled: true @@ -113,10 +111,8 @@ Layout/HashAlignment: Layout/HeredocIndentation: Enabled: false -<% if rubocop_version >= "1.67" %> Layout/LeadingCommentSpace: AllowRBSInlineAnnotation: true -<% end %> Layout/LineContinuationLeadingSpace: Enabled: true @@ -185,10 +181,8 @@ Lint/AmbiguousRange: Lint/AmbiguousRegexpLiteral: Enabled: false -<% if rubocop_version >= "1.71" %> Lint/ArrayLiteralInRegexp: Enabled: false -<% end %> Lint/AssignmentInCondition: Enabled: false @@ -202,15 +196,11 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Enabled: true -<% if rubocop_version >= "1.70" %> Lint/ConstantReassignment: Enabled: true -<% end %> -<% if rubocop_version >= "1.72" %> Lint/CopDirectiveSyntax: Enabled: true -<% end %> Lint/DeprecatedConstants: Enabled: false @@ -227,10 +217,8 @@ Lint/DuplicateMatchPattern: Lint/DuplicateRegexpCharacterClassElement: Enabled: true -<% if rubocop_version >= "1.67" %> Lint/DuplicateSetElement: Enabled: true -<% end %> Lint/EmptyBlock: Enabled: false @@ -268,10 +256,8 @@ Lint/FormatParameterMismatch: Lint/HashCompareByIdentity: Enabled: false -<% if rubocop_version >= "1.69" %> Lint/HashNewWithKeywordArgumentsAsDefault: Enabled: false -<% end %> Lint/IdentityComparison: Enabled: false @@ -318,10 +304,8 @@ Lint/NonLocalExitFromIterator: Lint/NumberedParameterAssignment: Enabled: false -<% if rubocop_version >= "1.69" %> Lint/NumericOperationWithConstantResult: Enabled: true -<% end %> Lint/OrAssignmentToConstant: Enabled: true @@ -359,10 +343,8 @@ Lint/RedundantSafeNavigation: Lint/RedundantSplatExpansion: Enabled: false -<% if rubocop_version >= "1.72" %> Lint/RedundantTypeConversion: Enabled: false -<% end %> Lint/RefinementImportMethods: Enabled: false @@ -403,10 +385,8 @@ Lint/ShadowedException: Lint/ShadowingOuterLocalVariable: Enabled: false -<% if rubocop_version >= "1.70" %> Lint/SharedMutableDefault: Enabled: false -<% end %> Lint/StructNewOverride: Enabled: false @@ -414,10 +394,8 @@ Lint/StructNewOverride: Lint/SuppressedException: Enabled: false -<% if rubocop_version >= "1.72" %> Lint/SuppressedExceptionInNumberConversion: Enabled: false -<% end %> Lint/SymbolConversion: Enabled: false @@ -437,10 +415,8 @@ Lint/TripleQuotes: Lint/UnderscorePrefixedVariableName: Enabled: false -<% if rubocop_version >= "1.68" %> Lint/UnescapedBracketInRegexp: Enabled: false -<% end %> Lint/UnexpectedBlockArity: Enabled: false @@ -475,15 +451,11 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Enabled: false -<% if rubocop_version >= "1.72" %> Lint/UselessConstantScoping: Enabled: false -<% end %> -<% if rubocop_version >= "1.69" %> Lint/UselessDefined: Enabled: false -<% end %> Lint/UselessElseWithoutRescue: Enabled: false @@ -491,10 +463,8 @@ Lint/UselessElseWithoutRescue: Lint/UselessMethodDefinition: Enabled: false -<% if rubocop_version >= "1.66" %> Lint/UselessNumericOperation: Enabled: false -<% end %> Lint/UselessRescue: Enabled: false @@ -643,10 +613,8 @@ Style/Alias: Enabled: false EnforcedStyle: prefer_alias_method -<% if rubocop_version >= "1.68" %> Style/AmbiguousEndlessMethodDefinition: Enabled: false -<% end %> Style/AndOr: Enabled: false @@ -672,10 +640,8 @@ Style/BeginBlock: Style/BisectedAttrAccessor: Enabled: false -<% if rubocop_version >= "1.68" %> Style/BitwisePredicate: Enabled: false -<% end %> Style/BlockComments: Enabled: false @@ -721,10 +687,8 @@ Style/ColonMethodCall: Style/ColonMethodDefinition: Enabled: false -<% if rubocop_version >= "1.68" %> Style/CombinableDefined: Enabled: false -<% end %> Style/CombinableLoops: Enabled: false @@ -754,10 +718,8 @@ Style/DataInheritance: Style/DefWithParentheses: Enabled: false -<% if rubocop_version >= "1.69" %> Style/DigChain: Enabled: false -<% end %> Style/Dir: Enabled: false @@ -841,18 +803,14 @@ Style/FetchEnvVar: Style/FileEmpty: Enabled: false -<% if rubocop_version >= "1.69" %> Style/FileNull: Enabled: false -<% end %> Style/FileRead: Enabled: false -<% if rubocop_version >= "1.69" %> Style/FileTouch: Enabled: false -<% end %> Style/FileWrite: Enabled: false @@ -900,16 +858,11 @@ Style/HashExcept: Style/HashLikeCase: Enabled: false -<% if rubocop_version >= "1.71" %> Style/HashSlice: Enabled: false -<% end %> Style/HashSyntax: Enabled: false -<% if rubocop_version < "1.67" %> - EnforcedShorthandSyntax: either -<% end %> Style/HashTransformKeys: Enabled: false @@ -944,15 +897,11 @@ Style/InfiniteLoop: Style/InverseMethods: Enabled: false -<% if rubocop_version >= "1.70" %> Style/ItAssignment: Enabled: false -<% end %> -<% if rubocop_version >= "1.68" %> Style/KeywordArgumentsMerging: Enabled: false -<% end %> Style/KeywordParametersOrder: Enabled: false @@ -973,10 +922,8 @@ Style/MagicCommentFormat: Style/MapCompactWithConditionalBlock: Enabled: false -<% if rubocop_version >= "1.63" %> Style/MapIntoArray: Enabled: false -<% end %> Style/MapToHash: Enabled: false @@ -1196,10 +1143,8 @@ Style/RedundantFileExtensionInRequire: Style/RedundantFilterChain: Enabled: false -<% if rubocop_version >= "1.72" %> Style/RedundantFormat: Enabled: false -<% end %> Style/RedundantFreeze: Enabled: false @@ -1213,10 +1158,8 @@ Style/RedundantInitialize: Style/RedundantInterpolation: Enabled: false -<% if rubocop_version >= "1.66" %> Style/RedundantInterpolationUnfreeze: Enabled: false -<% end %> Style/RedundantLineContinuation: Enabled: false @@ -1276,10 +1219,8 @@ Style/ReturnNilInPredicateMethodDefinition: Style/SafeNavigation: Enabled: false -<% if rubocop_version >= "1.68" %> Style/SafeNavigationChainLength: Enabled: false -<% end %> Style/Sample: Enabled: false @@ -1293,10 +1234,8 @@ Style/SelfAssignment: Style/Semicolon: Enabled: false -<% if rubocop_version >= "1.64" %> Style/SendWithLiteralMethodName: Enabled: false -<% end %> Style/SignalException: Enabled: false @@ -1345,10 +1284,8 @@ Style/Strip: Style/StructInheritance: Enabled: false -<% if rubocop_version >= "1.64" %> Style/SuperArguments: Enabled: false -<% end %> Style/SuperWithArgsParentheses: Enabled: false From 27d1f9a542539a82413e7240587920d5d6f63892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 3 Mar 2025 22:01:07 +0000 Subject: [PATCH 056/112] Disable Lint/NoReturnInBeginEndBlocks Now we have Lint/NoReturnInMemoization cop that should replace this one. --- rubocop.yml | 2 +- test/fixtures/full_config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 6b0adb9e..13c64684 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -290,7 +290,7 @@ Lint/MixedRegexpCaptureTypes: Enabled: false Lint/NoReturnInBeginEndBlocks: - Enabled: true + Enabled: false Lint/NonAtomicFileOperation: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 2282967f..6c7b7fce 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1553,7 +1553,7 @@ Lint/NextWithoutAccumulator: VersionAdded: '0.36' Lint/NoReturnInBeginEndBlocks: Description: Do not `return` inside `begin..end` blocks in assignment contexts. - Enabled: true + Enabled: false VersionAdded: '1.2' Lint/NonAtomicFileOperation: Description: Checks for non-atomic file operations. From 2babdaacf61fac8a9ab25b163f023aa154f3e527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 3 Mar 2025 22:03:21 +0000 Subject: [PATCH 057/112] Bump the gem version to 3.0.0 Make explicit that this is going to be a major version bump. --- Gemfile.lock | 2 +- lib/rubocop/shopify/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b70104d7..ce45a55b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rubocop-shopify (2.15.1) + rubocop-shopify (3.0.0) lint_roller rubocop (~> 1.72) diff --git a/lib/rubocop/shopify/version.rb b/lib/rubocop/shopify/version.rb index 3d3b8402..5ab4b020 100644 --- a/lib/rubocop/shopify/version.rb +++ b/lib/rubocop/shopify/version.rb @@ -2,6 +2,6 @@ module RuboCop module Shopify - VERSION = "2.15.1" + VERSION = "3.0.0" end end From a288883663046c07dd87fa2a3b85c2f5315b46ca Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 3 Mar 2025 23:31:45 +0000 Subject: [PATCH 058/112] Ensure no leftover RuboCop version checks As we may increase the minimum RuboCop version requirement soon, we should make sure that if we do, we don't leave behind redundant version checks. This adds a test to enforce they are cleaned up. --- test/config_test.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/config_test.rb b/test/config_test.rb index 2dec1dfe..db9355dd 100644 --- a/test/config_test.rb +++ b/test/config_test.rb @@ -90,6 +90,32 @@ def test_no_cops_are_configured_as_pending ERROR_MESSAGE end + def test_config_does_not_check_for_rubocop_versions_below_minimum_version + rubocop_version_requirement = Gem + .loaded_specs.fetch('rubocop-shopify') + .dependencies.find { _1.name == 'rubocop' } + .requirement + + # RuboCop version checks are done in ERB, so we need to read the raw file + redundant_rubocop_version_checks = File.read('rubocop.yml').each_line.with_index.filter_map do |line, index| + match = line.match(/<% if rubocop_version >= "(?.*)" %>/) + next unless match + + minimum_version_for_config = Gem::Version.new(match[1]) + next if rubocop_version_requirement.satisfied_by?(minimum_version_for_config) + + [index, line.chomp] + end + + assert(redundant_rubocop_version_checks.empty?, <<~ERROR_MESSAGE.chomp) + The following RuboCop version check(s) are redundant given the gemspec's version requirement (#{rubocop_version_requirement}): + + #{redundant_rubocop_version_checks.map { " #{_1.to_s.rjust(4)}: #{_2}" }.join("\n")} + + Please remove these check(s), or (if you intend to maintain compatibility) loosen the `rubocop` requirement in the gemspec. + ERROR_MESSAGE + end + private def checking_rubocop_version_compatibility? From 4fa7fd6be760149bf024bbe17008b0206fb24bda Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 4 Mar 2025 19:03:46 +0000 Subject: [PATCH 059/112] Drop redundant `ruby-version` config This workflow does not use a matrix of Ruby versions, so we can drop the `ruby-version` config, which will result in the action using the existing `.ruby-version` file to select the version, removing the need to keep this file in sync. --- .github/workflows/dump-config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index 2f8db72d..4a4d76b1 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -30,7 +30,6 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.4.1' bundler-cache: true - name: Dump config From 8375d20d3d013b5c15d61c16139761ffe345c41a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 22:21:04 +0000 Subject: [PATCH 060/112] Bump prismjs from 1.29.0 to 1.30.0 Bumps [prismjs](https://github.com/PrismJS/prism) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.29.0...v1.30.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index dcda2f28..965382af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3479,10 +3479,11 @@ } }, "node_modules/prismjs": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", - "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -7003,9 +7004,9 @@ "dev": true }, "prismjs": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", - "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", "dev": true }, "promise": { From 8af268f03692c6a322e351df638d1dfd49209e6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 15:45:31 +0000 Subject: [PATCH 061/112] Bump minitest from 5.25.4 to 5.25.5 Bumps [minitest](https://github.com/minitest/minitest) from 5.25.4 to 5.25.5. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.25.4...v5.25.5) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 60de09ac..dff3bc24 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,7 +16,7 @@ GEM language_server-protocol (3.17.0.4) lint_roller (1.1.0) method_source (1.0.0) - minitest (5.25.4) + minitest (5.25.5) parallel (1.26.3) parser (3.3.7.1) ast (~> 2.4.1) From 00c17f33bde11b1b4ee9f5e918f2fca410deadce Mon Sep 17 00:00:00 2001 From: Alex Park Date: Thu, 20 Mar 2025 16:36:38 -0400 Subject: [PATCH 062/112] Fix `bin/sort-cops` usage instructions --- bin/sort-cops | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sort-cops b/bin/sort-cops index 61a78d94..c4eaf5f9 100755 --- a/bin/sort-cops +++ b/bin/sort-cops @@ -58,7 +58,7 @@ def sort_cops(file_path) end if ARGV.empty? - puts "Usage: ruby sort_cops.rb path/to/rubocop.yml" + puts "Usage: ruby sort-cops path/to/rubocop.yml" exit 1 end From bab669c8b204528dd59ecda421e37c2f9923951b Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 20 Mar 2025 16:37:08 -0400 Subject: [PATCH 063/112] Teach `minimum_rubocop.gemfile` to handle `>=` too This allows us to combine `~>` and `>=` `rubocop` version requirements. --- gemfiles/minimum_rubocop.gemfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/gemfiles/minimum_rubocop.gemfile b/gemfiles/minimum_rubocop.gemfile index fef7f2ba..25f38632 100644 --- a/gemfiles/minimum_rubocop.gemfile +++ b/gemfiles/minimum_rubocop.gemfile @@ -2,9 +2,21 @@ eval_gemfile "../Gemfile" -# This naively extracts the minimum rubocop version from our gemspec, +# This extracts the minimum rubocop version from our gemspec, # allowing us to ensure that it remains compatible. -minimum_rubocop_version = File.read("rubocop-shopify.gemspec")[/(?<=add_dependency\("rubocop", "~> ).*(?="\)$)/] -raise "Failed to extract minimum rubocop version from gemspec" if minimum_rubocop_version.nil? -gem "rubocop", minimum_rubocop_version +supported_requirement_types = ['>=', '~>'] +supported_requirements, unsupported_requirements = Gem::Specification + .load("rubocop-shopify.gemspec") + .dependencies.find { |d| d.name == "rubocop" } + .requirement.requirements + .partition { |type, _version| supported_requirement_types.include?(type) } + +raise <<~ERROR_MESSAGE unless unsupported_requirements.empty? + Unsupported requirement types: #{unsupported_requirements.inspect}. + Only #{supported_requirement_types.inspect} are supported. +ERROR_MESSAGE + +minimum_version = supported_requirements.map { |_type, version| version }.max + +gem "rubocop", minimum_version From c1d4df87a12e203ace35d330dd6f34507a41e7f5 Mon Sep 17 00:00:00 2001 From: Alex Park Date: Thu, 20 Mar 2025 16:39:08 -0400 Subject: [PATCH 064/112] Add `rubocop-thread_safety` This plugin helps ensure thread safety. As it uses the new RuboCop plugin API, we must bump the minimum RuboCop version, and as such we can remove many of our version checks. --- Gemfile.lock | 8 +++- rubocop-shopify.gemspec | 3 +- rubocop.yml | 77 +++++++---------------------------- test/fixtures/full_config.yml | 47 +++++++++++++++------ 4 files changed, 57 insertions(+), 78 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 60de09ac..e055b698 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,8 @@ PATH remote: . specs: rubocop-shopify (2.15.1) - rubocop (~> 1.62) + rubocop (~> 1.72, >= 1.72.1) + rubocop-thread_safety (>= 0.7.1) GEM remote: https://rubygems.org/ @@ -31,7 +32,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) - rubocop (1.73.1) + rubocop (1.72.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -44,6 +45,9 @@ GEM unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.38.1) parser (>= 3.3.1.0) + rubocop-thread_safety (0.7.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index dcd0d18b..c1bea38f 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -23,5 +23,6 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 3.1.0" - s.add_dependency("rubocop", "~> 1.62") + s.add_dependency("rubocop", "~> 1.72", ">= 1.72.1") + s.add_dependency("rubocop-thread_safety", ">= 0.7.1") end diff --git a/rubocop.yml b/rubocop.yml index 61c5305f..60c5eea0 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -9,6 +9,8 @@ inherit_mode: - Exclude - Include +plugins: rubocop-thread_safety + AllCops: StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ NewCops: disable # New cops will be triaged by style guide maintainers instead. @@ -19,10 +21,8 @@ Bundler/OrderedGems: # Gemspec Department -<% if rubocop_version >= "1.65" %> Gemspec/AddRuntimeDependency: Enabled: false -<% end %> Gemspec/DeprecatedAttributeAssignment: Enabled: true @@ -110,10 +110,8 @@ Layout/HashAlignment: Layout/HeredocIndentation: Enabled: false -<% if rubocop_version >= "1.67" %> Layout/LeadingCommentSpace: AllowRBSInlineAnnotation: true -<% end %> Layout/LineContinuationLeadingSpace: Enabled: true @@ -185,10 +183,8 @@ Lint/AmbiguousRange: Lint/AmbiguousRegexpLiteral: Enabled: false -<% if rubocop_version >= "1.71" %> Lint/ArrayLiteralInRegexp: Enabled: false -<% end %> Lint/AssignmentInCondition: Enabled: false @@ -211,15 +207,11 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Enabled: false -<% if rubocop_version >= "1.70" %> Lint/ConstantReassignment: Enabled: false -<% end %> -<% if rubocop_version >= "1.72" %> Lint/CopDirectiveSyntax: Enabled: false -<% end %> Lint/Debugger: Enabled: false @@ -266,10 +258,8 @@ Lint/DuplicateRequire: Lint/DuplicateRescueException: Enabled: false -<% if rubocop_version >= "1.67" %> Lint/DuplicateSetElement: Enabled: false -<% end %> Lint/EachWithObjectArgument: Enabled: false @@ -325,10 +315,8 @@ Lint/FormatParameterMismatch: Lint/HashCompareByIdentity: Enabled: false -<% if rubocop_version >= "1.69" %> Lint/HashNewWithKeywordArgumentsAsDefault: Enabled: false -<% end %> Lint/IdentityComparison: Enabled: false @@ -405,10 +393,8 @@ Lint/NonLocalExitFromIterator: Lint/NumberedParameterAssignment: Enabled: false -<% if rubocop_version >= "1.69" %> Lint/NumericOperationWithConstantResult: Enabled: false -<% end %> Lint/OrAssignmentToConstant: Enabled: false @@ -458,10 +444,8 @@ Lint/RedundantSplatExpansion: Lint/RedundantStringCoercion: Enabled: false -<% if rubocop_version >= "1.72" %> Lint/RedundantTypeConversion: Enabled: false -<% end %> Lint/RedundantWithIndex: Enabled: false @@ -520,10 +504,8 @@ Lint/ShadowedException: Lint/ShadowingOuterLocalVariable: Enabled: false -<% if rubocop_version >= "1.70" %> Lint/SharedMutableDefault: Enabled: false -<% end %> Lint/StructNewOverride: Enabled: false @@ -531,10 +513,8 @@ Lint/StructNewOverride: Lint/SuppressedException: Enabled: false -<% if rubocop_version >= "1.72" %> Lint/SuppressedExceptionInNumberConversion: Enabled: false -<% end %> Lint/SymbolConversion: Enabled: false @@ -557,10 +537,8 @@ Lint/TripleQuotes: Lint/UnderscorePrefixedVariableName: Enabled: false -<% if rubocop_version >= "1.68" %> Lint/UnescapedBracketInRegexp: Enabled: false -<% end %> Lint/UnexpectedBlockArity: Enabled: false @@ -595,15 +573,11 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Enabled: false -<% if rubocop_version >= "1.72" %> Lint/UselessConstantScoping: Enabled: false -<% end %> -<% if rubocop_version >= "1.69" %> Lint/UselessDefined: Enabled: false -<% end %> Lint/UselessElseWithoutRescue: Enabled: false @@ -611,10 +585,8 @@ Lint/UselessElseWithoutRescue: Lint/UselessMethodDefinition: Enabled: false -<% if rubocop_version >= "1.66" %> Lint/UselessNumericOperation: Enabled: false -<% end %> Lint/UselessRescue: Enabled: false @@ -763,10 +735,8 @@ Style/Alias: Enabled: false EnforcedStyle: prefer_alias_method -<% if rubocop_version >= "1.68" %> Style/AmbiguousEndlessMethodDefinition: Enabled: false -<% end %> Style/AndOr: Enabled: false @@ -792,10 +762,8 @@ Style/BeginBlock: Style/BisectedAttrAccessor: Enabled: false -<% if rubocop_version >= "1.68" %> Style/BitwisePredicate: Enabled: false -<% end %> Style/BlockComments: Enabled: false @@ -841,10 +809,8 @@ Style/ColonMethodCall: Style/ColonMethodDefinition: Enabled: false -<% if rubocop_version >= "1.68" %> Style/CombinableDefined: Enabled: false -<% end %> Style/CombinableLoops: Enabled: false @@ -874,10 +840,8 @@ Style/DataInheritance: Style/DefWithParentheses: Enabled: false -<% if rubocop_version >= "1.69" %> Style/DigChain: Enabled: false -<% end %> Style/Dir: Enabled: false @@ -961,18 +925,14 @@ Style/FetchEnvVar: Style/FileEmpty: Enabled: false -<% if rubocop_version >= "1.69" %> Style/FileNull: Enabled: false -<% end %> Style/FileRead: Enabled: false -<% if rubocop_version >= "1.69" %> Style/FileTouch: Enabled: false -<% end %> Style/FileWrite: Enabled: false @@ -1020,16 +980,11 @@ Style/HashExcept: Style/HashLikeCase: Enabled: false -<% if rubocop_version >= "1.71" %> Style/HashSlice: Enabled: false -<% end %> Style/HashSyntax: Enabled: false -<% if rubocop_version < "1.67" %> - EnforcedShorthandSyntax: either -<% end %> Style/HashTransformKeys: Enabled: false @@ -1064,15 +1019,11 @@ Style/InfiniteLoop: Style/InverseMethods: Enabled: false -<% if rubocop_version >= "1.70" %> Style/ItAssignment: Enabled: false -<% end %> -<% if rubocop_version >= "1.68" %> Style/KeywordArgumentsMerging: Enabled: false -<% end %> Style/KeywordParametersOrder: Enabled: false @@ -1093,10 +1044,8 @@ Style/MagicCommentFormat: Style/MapCompactWithConditionalBlock: Enabled: false -<% if rubocop_version >= "1.63" %> Style/MapIntoArray: Enabled: false -<% end %> Style/MapToHash: Enabled: false @@ -1316,10 +1265,8 @@ Style/RedundantFileExtensionInRequire: Style/RedundantFilterChain: Enabled: false -<% if rubocop_version >= "1.72" %> Style/RedundantFormat: Enabled: false -<% end %> Style/RedundantFreeze: Enabled: false @@ -1333,10 +1280,8 @@ Style/RedundantInitialize: Style/RedundantInterpolation: Enabled: false -<% if rubocop_version >= "1.66" %> Style/RedundantInterpolationUnfreeze: Enabled: false -<% end %> Style/RedundantLineContinuation: Enabled: false @@ -1396,10 +1341,8 @@ Style/ReturnNilInPredicateMethodDefinition: Style/SafeNavigation: Enabled: false -<% if rubocop_version >= "1.68" %> Style/SafeNavigationChainLength: Enabled: false -<% end %> Style/Sample: Enabled: false @@ -1413,10 +1356,8 @@ Style/SelfAssignment: Style/Semicolon: Enabled: false -<% if rubocop_version >= "1.64" %> Style/SendWithLiteralMethodName: Enabled: false -<% end %> Style/SignalException: Enabled: false @@ -1465,10 +1406,8 @@ Style/Strip: Style/StructInheritance: Enabled: false -<% if rubocop_version >= "1.64" %> Style/SuperArguments: Enabled: false -<% end %> Style/SuperWithArgsParentheses: Enabled: false @@ -1549,3 +1488,15 @@ Style/YodaCondition: Style/ZeroLengthPredicate: Enabled: false + +ThreadSafety/ClassInstanceVariable: + Enabled: false + +ThreadSafety/MutableClassInstanceVariable: + Enabled: false + +ThreadSafety/NewThread: + Enabled: false + +ThreadSafety/RackMiddlewareInstanceVariable: + Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index cf4bf211..5a381377 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1489,7 +1489,6 @@ Lint/LambdaWithoutLiteralBlock: Lint/LiteralAsCondition: Description: Checks of literals used in conditions. Enabled: false - AutoCorrect: contextual VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: Description: Checks for literal assignments in the conditions. @@ -1659,8 +1658,9 @@ Lint/RedundantRegexpQuantifiers: Lint/RedundantRequireStatement: Description: Checks for unnecessary `require` statement. Enabled: false + SafeAutoCorrect: false VersionAdded: '0.76' - VersionChanged: '1.73' + VersionChanged: '1.57' Lint/RedundantSafeNavigation: Description: Checks for redundant safe navigation calls. Enabled: false @@ -2332,15 +2332,13 @@ Naming/VariableName: StyleGuide: "#snake-case-symbols-methods-vars" Enabled: false VersionAdded: '0.50' - VersionChanged: '1.73' + VersionChanged: '1.8' EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase AllowedIdentifiers: [] AllowedPatterns: [] - ForbiddenIdentifiers: [] - ForbiddenPatterns: [] Naming/VariableNumber: Description: Use the configured style when numbering symbols, methods and variables. StyleGuide: "#snake-case-symbols-methods-vars-with-numbers" @@ -2935,8 +2933,6 @@ Style/EndlessMethod: - allow_single_line - allow_always - disallow - - require_single_line - - require_always Style/EnvHome: Description: Checks for consistent usage of `ENV['HOME']`. Enabled: false @@ -3877,9 +3873,6 @@ Style/RedundantCondition: Description: Checks for unnecessary conditional expressions. Enabled: false VersionAdded: '0.76' - VersionChanged: '1.73' - AllowedMethods: - - nonzero? Style/RedundantConditional: Description: Don't return true/false from a conditional. Enabled: false @@ -4378,7 +4371,6 @@ Style/TrailingCommaInArrayLiteral: SupportedStylesForMultiline: - comma - consistent_comma - - diff_comma - no_comma Style/TrailingCommaInBlockArgs: Description: Checks for useless trailing commas in block arguments. @@ -4392,7 +4384,6 @@ Style/TrailingCommaInHashLiteral: SupportedStylesForMultiline: - comma - consistent_comma - - diff_comma - no_comma VersionAdded: '0.53' Style/TrailingMethodEndStatement: @@ -4523,6 +4514,38 @@ Style/ZeroLengthPredicate: Safe: false VersionAdded: '0.37' VersionChanged: '0.39' +ThreadSafety/ClassAndModuleAttributes: + Description: Avoid mutating class and module attributes. + Enabled: true + ActiveSupportClassAttributeAllowed: false +ThreadSafety/ClassInstanceVariable: + Description: Avoid class instance variables. + Enabled: false +ThreadSafety/MutableClassInstanceVariable: + Description: Do not assign mutable objects to class instance variables. + Enabled: false + EnforcedStyle: literals + SafeAutoCorrect: false + SupportedStyles: + - literals + - strict +ThreadSafety/NewThread: + Description: Avoid starting new threads. Let a framework like Sidekiq handle the + threads. + Enabled: false +ThreadSafety/DirChdir: + Description: Avoid using `Dir.chdir` due to its process-wide effect. + Enabled: true + AllowCallWithBlock: false +ThreadSafety/RackMiddlewareInstanceVariable: + Description: Avoid instance variables in Rack middleware. + Enabled: false + Include: + - app/middleware/**/*.rb + - lib/middleware/**/*.rb + - app/middlewares/**/*.rb + - lib/middlewares/**/*.rb + AllowedIdentifiers: [] inherit_mode: merge: - Exclude From a8dd1f009c82eab932f63d753d9b7208ed444c15 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 20 Mar 2025 16:41:52 -0400 Subject: [PATCH 065/112] Stop disabling `Style/MutableConstant` --- rubocop.yml | 3 --- test/fixtures/full_config.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 60c5eea0..1e9da612 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1113,9 +1113,6 @@ Style/MultilineWhenThen: Style/MultipleComparison: Enabled: false -Style/MutableConstant: - Enabled: false - Style/NegatedIf: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 5a381377..8aba5d50 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -3522,7 +3522,7 @@ Style/MultipleComparison: ComparisonsThreshold: 2 Style/MutableConstant: Description: Do not assign mutable objects to constants. - Enabled: false + Enabled: true VersionAdded: '0.34' VersionChanged: '1.8' SafeAutoCorrect: false From 0313405e87fb0ddc623d14828a4c5535ef430b8c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 15:48:26 +0000 Subject: [PATCH 066/112] Bump json from 2.10.1 to 2.10.2 Bumps [json](https://github.com/ruby/json) from 2.10.1 to 2.10.2. - [Release notes](https://github.com/ruby/json/releases) - [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md) - [Commits](https://github.com/ruby/json/compare/v2.10.1...v2.10.2) --- updated-dependencies: - dependency-name: json dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e055b698..787b01ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,7 +13,7 @@ GEM byebug (11.1.3) coderay (1.1.3) diffy (3.4.3) - json (2.10.1) + json (2.10.2) language_server-protocol (3.17.0.4) lint_roller (1.1.0) method_source (1.0.0) From 53ab95e083cea4f80d08dd71340f5be9f31f7d07 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 24 Mar 2025 16:11:57 -0400 Subject: [PATCH 067/112] Group all `*rubocop*` gem bumps This way we get the changelogs for all of them. --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 31e033d2..7be023fd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,10 @@ updates: versioning-strategy: increase schedule: interval: daily + groups: + rubocop: + patterns: + - "*rubocop*" ignore: - dependency-name: "rubocop" # We only care about versions that might change config From a1580d21720dadd01080680ba81fd3e06d694bd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 17:35:34 +0000 Subject: [PATCH 068/112] Bump the rubocop group with 2 updates Bumps the rubocop group with 2 updates: [rubocop](https://github.com/rubocop/rubocop) and [rubocop-thread_safety](https://github.com/rubocop/rubocop-thread_safety). Updates `rubocop` from 1.72.2 to 1.74.0 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.72.2...v1.74.0) Updates `rubocop-thread_safety` from 0.7.1 to 0.7.2 - [Changelog](https://github.com/rubocop/rubocop-thread_safety/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-thread_safety/compare/v0.7.1...v0.7.2) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop - dependency-name: rubocop-thread_safety dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 12 +++++------ test/fixtures/full_config.yml | 39 +++++++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2eabd054..6a44ceb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) base64 (0.2.0) byebug (11.1.3) coderay (1.1.3) @@ -19,7 +19,7 @@ GEM method_source (1.0.0) minitest (5.25.5) parallel (1.26.3) - parser (3.3.7.1) + parser (3.3.7.2) ast (~> 2.4.1) racc pry (0.14.2) @@ -32,7 +32,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) - rubocop (1.72.2) + rubocop (1.74.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -43,9 +43,9 @@ GEM rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.1) - parser (>= 3.3.1.0) - rubocop-thread_safety (0.7.1) + rubocop-ast (1.42.0) + parser (>= 3.3.7.2) + rubocop-thread_safety (0.7.2) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 8aba5d50..25db13c3 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1358,10 +1358,9 @@ Lint/EmptyConditionalBody: a body. Enabled: false AutoCorrect: contextual - SafeAutoCorrect: false AllowComments: true VersionAdded: '0.89' - VersionChanged: '1.61' + VersionChanged: '1.73' Lint/EmptyEnsure: Description: Checks for empty ensure block. Enabled: false @@ -1489,6 +1488,7 @@ Lint/LambdaWithoutLiteralBlock: Lint/LiteralAsCondition: Description: Checks of literals used in conditions. Enabled: false + AutoCorrect: contextual VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: Description: Checks for literal assignments in the conditions. @@ -1658,9 +1658,8 @@ Lint/RedundantRegexpQuantifiers: Lint/RedundantRequireStatement: Description: Checks for unnecessary `require` statement. Enabled: false - SafeAutoCorrect: false VersionAdded: '0.76' - VersionChanged: '1.57' + VersionChanged: '1.73' Lint/RedundantSafeNavigation: Description: Checks for redundant safe navigation calls. Enabled: false @@ -2332,13 +2331,15 @@ Naming/VariableName: StyleGuide: "#snake-case-symbols-methods-vars" Enabled: false VersionAdded: '0.50' - VersionChanged: '1.8' + VersionChanged: '1.73' EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase AllowedIdentifiers: [] AllowedPatterns: [] + ForbiddenIdentifiers: [] + ForbiddenPatterns: [] Naming/VariableNumber: Description: Use the configured style when numbering symbols, methods and variables. StyleGuide: "#snake-case-symbols-methods-vars-with-numbers" @@ -2353,6 +2354,8 @@ Naming/VariableNumber: CheckMethodNames: true CheckSymbols: true AllowedIdentifiers: + - TLS1_1 + - TLS1_2 - capture3 - iso8601 - rfc1123_date @@ -2611,10 +2614,21 @@ Style/ClassAndModuleChildren: SafeAutoCorrect: false Enabled: false VersionAdded: '0.19' + VersionChanged: '1.74' EnforcedStyle: nested SupportedStyles: - nested - compact + EnforcedStyleForClasses: + SupportedStylesForClasses: + - + - nested + - compact + EnforcedStyleForModules: + SupportedStylesForModules: + - + - nested + - compact Style/ClassCheck: Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`. StyleGuide: "#is-a-vs-kind-of" @@ -2737,6 +2751,11 @@ Style/CommentedKeyword: SafeAutoCorrect: false VersionAdded: '0.51' VersionChanged: '1.19' +Style/ComparableBetween: + Description: Enforces the use of `Comparable#between?` instead of logical comparison. + Enabled: pending + VersionAdded: '1.74' + StyleGuide: "#ranges-or-between" Style/ComparableClamp: Description: Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum. @@ -2933,6 +2952,8 @@ Style/EndlessMethod: - allow_single_line - allow_always - disallow + - require_single_line + - require_always Style/EnvHome: Description: Checks for consistent usage of `ENV['HOME']`. Enabled: false @@ -3053,8 +3074,9 @@ Style/FormatStringToken: - template - unannotated MaxUnannotatedPlaceholdersAllowed: 1 + Mode: aggressive VersionAdded: '0.49' - VersionChanged: '1.0' + VersionChanged: '1.74' AllowedMethods: [] AllowedPatterns: [] Style/FrozenStringLiteralComment: @@ -3873,6 +3895,9 @@ Style/RedundantCondition: Description: Checks for unnecessary conditional expressions. Enabled: false VersionAdded: '0.76' + VersionChanged: '1.73' + AllowedMethods: + - nonzero? Style/RedundantConditional: Description: Don't return true/false from a conditional. Enabled: false @@ -4371,6 +4396,7 @@ Style/TrailingCommaInArrayLiteral: SupportedStylesForMultiline: - comma - consistent_comma + - diff_comma - no_comma Style/TrailingCommaInBlockArgs: Description: Checks for useless trailing commas in block arguments. @@ -4384,6 +4410,7 @@ Style/TrailingCommaInHashLiteral: SupportedStylesForMultiline: - comma - consistent_comma + - diff_comma - no_comma VersionAdded: '0.53' Style/TrailingMethodEndStatement: From df9a591a4908d1a0f139551b9d0b08d4cafd6e18 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 25 Mar 2025 13:40:30 -0400 Subject: [PATCH 069/112] Disable `Style/ComparableBetween` We have yet to triage the `Style` group following the "Great Reset", so we'll defer triaging this new cop until then. --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 1e9da612..0ddeec11 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -825,6 +825,11 @@ Style/CommentAnnotation: Style/CommentedKeyword: Enabled: false +<% if rubocop_version >= "1.74" %> +Style/ComparableBetween: + Enabled: false +<% end %> + Style/ComparableClamp: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 25db13c3..346feb1f 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2753,7 +2753,7 @@ Style/CommentedKeyword: VersionChanged: '1.19' Style/ComparableBetween: Description: Enforces the use of `Comparable#between?` instead of logical comparison. - Enabled: pending + Enabled: false VersionAdded: '1.74' StyleGuide: "#ranges-or-between" Style/ComparableClamp: From db07f59e339527740e1d8e66c33bfb4c5c074e1b Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 25 Mar 2025 14:23:37 -0400 Subject: [PATCH 070/112] Fix dump-config workflow commmit message newlines We want the blank lines. Dump full RuboCop config + This automated commit dumps the contents of the full RuboCop config. + [dependabot skip] --- .github/workflows/dump-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index 4a4d76b1..0aa95be5 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -41,7 +41,7 @@ jobs: with: add: 'test/fixtures/full_config.yml' default_author: github_actions - message: > + message: | Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. From 9f5d0651858cd0a9daf9c7428a00023091480d7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:16:50 +0000 Subject: [PATCH 071/112] Bump rubocop from 1.74.0 to 1.75.0 in the rubocop group Bumps the rubocop group with 1 update: [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop` from 1.74.0 to 1.75.0 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.74.0...v1.75.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6a44ceb0..e5076770 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,9 +19,10 @@ GEM method_source (1.0.0) minitest (5.25.5) parallel (1.26.3) - parser (3.3.7.2) + parser (3.3.7.3) ast (~> 2.4.1) racc + prism (1.4.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -32,7 +33,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) - rubocop (1.74.0) + rubocop (1.75.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -40,11 +41,12 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.43.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.42.0) + rubocop-ast (1.43.0) parser (>= 3.3.7.2) + prism (~> 1.4) rubocop-thread_safety (0.7.2) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) From 2d3c62e732393440ae03dcc7c32e48a18e78b395 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:17:41 +0000 Subject: [PATCH 072/112] Disable `Style/{HashFetchChain,ItBlockParameter}` We haven't re-triaged the `Style` department yet, so these pending cops will start off disabled. --- rubocop.yml | 10 ++++++++++ test/fixtures/full_config.yml | 27 ++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 0ddeec11..d85a4f2d 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -982,6 +982,11 @@ Style/HashEachMethods: Style/HashExcept: Enabled: false +<% if rubocop_version >= "1.75" %> +Style/HashFetchChain: + Enabled: false +<% end %> + Style/HashLikeCase: Enabled: false @@ -1027,6 +1032,11 @@ Style/InverseMethods: Style/ItAssignment: Enabled: false +<% if rubocop_version >= "1.75" %> +Style/ItBlockParameter: + Enabled: false +<% end %> + Style/KeywordArgumentsMerging: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 346feb1f..716724f2 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -81,7 +81,7 @@ AllCops: CacheRootDirectory: AllowSymlinksInCacheRootDirectory: false TargetRubyVersion: - ParserEngine: parser_whitequark + ParserEngine: default SuggestExtensions: rubocop-rails: - rails @@ -2271,12 +2271,17 @@ Naming/MethodName: StyleGuide: "#snake-case-symbols-methods-vars" Enabled: false VersionAdded: '0.50' + VersionChanged: '1.75' EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase AllowedPatterns: - "\\Atest_" + ForbiddenIdentifiers: + - __id__ + - __send__ + ForbiddenPatterns: [] Naming/MethodParameterName: Description: Checks for method parameter names that contain capital letters, end in numbers, or do not meet a minimal length. @@ -2307,7 +2312,7 @@ Naming/PredicateName: StyleGuide: "#bool-methods-qmark" Enabled: false VersionAdded: '0.50' - VersionChanged: '0.77' + VersionChanged: '1.75' NamePrefix: - is_ ForbiddenPrefixes: @@ -3151,6 +3156,11 @@ Style/HashExcept: Safe: false VersionAdded: '1.7' VersionChanged: '1.39' +Style/HashFetchChain: + Description: Use `Hash#dig` instead of chained `fetch` calls. + Enabled: false + Safe: false + VersionAdded: '1.75' Style/HashLikeCase: Description: Checks for places where `case-when` represents a simple 1:1 mapping and can be replaced with a hash lookup. @@ -3307,6 +3317,16 @@ Style/ItAssignment: Description: Checks for assignment to `it` inside a block. Enabled: false VersionAdded: '1.70' +Style/ItBlockParameter: + Description: Checks for blocks with one argument where `it` block parameter can + be used. + Enabled: false + EnforcedStyle: allow_named_parameter + SupportedStyles: + - allow_named_parameter + - always + - disallow + VersionAdded: '1.75' Style/KeywordArgumentsMerging: Description: When passing an existing hash as keyword arguments, provide additional arguments directly rather than using `merge`. @@ -3627,9 +3647,10 @@ Style/Next: StyleGuide: "#no-nested-conditionals" Enabled: false VersionAdded: '0.22' - VersionChanged: '0.35' + VersionChanged: '1.75' EnforcedStyle: skip_modifier_ifs MinBodyLength: 3 + AllowConsecutiveConditionals: false SupportedStyles: - skip_modifier_ifs - always From bf7a75462cbf0887abae6efb2b72b84445ebac05 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Fri, 28 Mar 2025 11:55:40 -0400 Subject: [PATCH 073/112] Drop `base64` development dependency This was added in #613 to address a warning when running with old RuboCop versions against new (at the time) Ruby versions. This warning was addressed in rubocop/rubocop#12313 (released in RuboCop version 1.57.2), and as out minimum RuboCop version has surpassed that, we can remove the dependency. --- Gemfile | 6 ------ Gemfile.lock | 2 -- 2 files changed, 8 deletions(-) diff --git a/Gemfile b/Gemfile index eabaf160..ae8acf1f 100644 --- a/Gemfile +++ b/Gemfile @@ -8,9 +8,3 @@ gem "diffy" gem "minitest" gem "pry-byebug" gem "rake" - -# Fixes the following warning on Ruby 3.3: -# base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. -# Add base64 to your Gemfile or gemspec. Also contact author of rubocop-1.53.0 to add base64 into its gemspec. -# Check if this is still necessary when the minimum RuboCop version is increased. -gem "base64" diff --git a/Gemfile.lock b/Gemfile.lock index e5076770..92286bbc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,6 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - base64 (0.2.0) byebug (11.1.3) coderay (1.1.3) diffy (3.4.3) @@ -59,7 +58,6 @@ PLATFORMS ruby DEPENDENCIES - base64 diffy minitest pry-byebug From 4e359544eb2a0092e880a47708c8806134a4a948 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:46:18 +0000 Subject: [PATCH 074/112] Bump actions/setup-node from 4.2.0 to 4.3.0 in the actions group Bumps the actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 4.2.0 to 4.3.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4.2.0...v4.3.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- .github/workflows/node.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 71f5d93b..45a80fdd 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.2.0 + uses: actions/setup-node@v4.3.0 with: node-version: '16' check-version: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index e330b8eb..9704511a 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.2.0 + uses: actions/setup-node@v4.3.0 with: node-version: '16' check-latest: true From 6b0bba5550ffa316a99173c5cb64aa0f127b19ca Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Fri, 28 Mar 2025 11:51:08 -0400 Subject: [PATCH 075/112] Remove development dependency on `pry-byebug` ...in favor of out-of-the-box `irb` and `debug`. --- Gemfile | 1 - Gemfile.lock | 10 ---------- test/ruby_versions_test.rb | 1 - test/test_helper.rb | 1 - 4 files changed, 13 deletions(-) diff --git a/Gemfile b/Gemfile index ae8acf1f..2c922141 100644 --- a/Gemfile +++ b/Gemfile @@ -6,5 +6,4 @@ gemspec gem "diffy" gem "minitest" -gem "pry-byebug" gem "rake" diff --git a/Gemfile.lock b/Gemfile.lock index 92286bbc..cae6edb4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,25 +9,16 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - byebug (11.1.3) - coderay (1.1.3) diffy (3.4.3) json (2.10.2) language_server-protocol (3.17.0.4) lint_roller (1.1.0) - method_source (1.0.0) minitest (5.25.5) parallel (1.26.3) parser (3.3.7.3) ast (~> 2.4.1) racc prism (1.4.0) - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) racc (1.8.1) rainbow (3.1.1) rake (13.2.1) @@ -60,7 +51,6 @@ PLATFORMS DEPENDENCIES diffy minitest - pry-byebug rake rubocop-shopify! diff --git a/test/ruby_versions_test.rb b/test/ruby_versions_test.rb index c2a4873e..e108e1ab 100644 --- a/test/ruby_versions_test.rb +++ b/test/ruby_versions_test.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require "test_helper" -require "pry" require "yaml" class RubyVersionsTest < Minitest::Test diff --git a/test/test_helper.rb b/test/test_helper.rb index dbb37cfb..f00aab16 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require "minitest/autorun" -require "pry-byebug" module Warning class << self From 2b59f8fd66801899cb15d279b45f4f73da212701 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 31 Mar 2025 12:44:41 -0400 Subject: [PATCH 076/112] Add Ruby 3.4 to CI matrix --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 4dab17f6..d71737d8 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: gemfile: [Gemfile, gemfiles/minimum_rubocop.gemfile] - ruby: ["3.1", "3.2", "3.3"] + ruby: ["3.1", "3.2", "3.3", "3.4"] env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} From 1a105e0bc95d0bc243855928447c55d0e390b2e4 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 31 Mar 2025 12:45:25 -0400 Subject: [PATCH 077/112] Drop support for Ruby 3.1 Official support for Ruby 3.1 ends March 31 2025. See https://www.ruby-lang.org/en/downloads/branches --- .github/workflows/ruby.yml | 2 +- rubocop-shopify.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d71737d8..6d48e519 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: gemfile: [Gemfile, gemfiles/minimum_rubocop.gemfile] - ruby: ["3.1", "3.2", "3.3", "3.4"] + ruby: ["3.2", "3.3", "3.4"] env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index c1bea38f..2153b8b2 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| "allowed_push_host" => "https://rubygems.org", } - s.required_ruby_version = ">= 3.1.0" + s.required_ruby_version = ">= 3.2.0" s.add_dependency("rubocop", "~> 1.72", ">= 1.72.1") s.add_dependency("rubocop-thread_safety", ">= 0.7.1") From f8df07ab732bbfdcf7ba0158212832175925bae3 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 31 Mar 2025 12:47:28 -0400 Subject: [PATCH 078/112] Drop `Gem::Version#===` with `String` backport As the minimum Ruby version is now 3.2, and its version of Rubygems includes support for using `Gem::Version#===` to compare with a `String`, we no longer need this backport. --- .../gem_version_string_comparable_backport.rb | 28 ------------------- rubocop.yml | 2 -- 2 files changed, 30 deletions(-) delete mode 100644 lib/rubocop/shopify/gem_version_string_comparable_backport.rb diff --git a/lib/rubocop/shopify/gem_version_string_comparable_backport.rb b/lib/rubocop/shopify/gem_version_string_comparable_backport.rb deleted file mode 100644 index aab75121..00000000 --- a/lib/rubocop/shopify/gem_version_string_comparable_backport.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# This is true for Ruby 3.2+, so once support for 3.1 is dropped, we can remove this. -# Until then, some installations may have a recent enough version of RubyGems, but it is not guaranteed. -return if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.5.6") - -module RuboCop - module Shopify - # Backport rubygems/rubygems#5275, so we can compare `Gem::Version`s directly against `String`s. - # - # Gem::Version.new("1.2.3") > "1.2" - # - # Without this, to support Ruby < 3.2, we would have to create a new `Gem::Version` instance ourselves. - # - # Gem::Version.new("1.2.3") > Gem::Version.new("1.2") - # - # This would get very verbose in our RuboCop config files. - module GemVersionStringComparableBackport - def <=>(other) - return self <=> self.class.new(other) if (String === other) && self.class.correct?(other) - - super - end - - Gem::Version.prepend(self) - end - end -end diff --git a/rubocop.yml b/rubocop.yml index d85a4f2d..25ad4f1b 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,6 +1,4 @@ <% - require "rubocop/shopify/gem_version_string_comparable_backport" - rubocop_version = Gem.loaded_specs.fetch("rubocop").version %> From c71645459f13e4ce5e4c94d48dde6304d16c40be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 1 Apr 2025 14:42:31 +0000 Subject: [PATCH 079/112] Enable Lint/SafeNavigationChain Documentation: https://docs.rubocop.org/rubocop/cops_lint.html#lintsafenavigationchain --- rubocop.yml | 3 --- test/fixtures/full_config.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 13c64684..e22ea21e 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -364,9 +364,6 @@ Lint/RescueException: Lint/RescueType: Enabled: false -Lint/SafeNavigationChain: - Enabled: false - Lint/SafeNavigationConsistency: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 6c7b7fce..145040a1 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1738,7 +1738,7 @@ Lint/ReturnInVoidContext: VersionAdded: '0.50' Lint/SafeNavigationChain: Description: Do not chain ordinary method call after safe navigation operator. - Enabled: false + Enabled: true VersionAdded: '0.47' VersionChanged: '0.77' AllowedMethods: From 91854b4db81952de4302d0350e1bb444bcbf63e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:23:08 +0000 Subject: [PATCH 080/112] Bump the rubocop group with 2 updates Bumps the rubocop group with 2 updates: [rubocop-minitest](https://github.com/rubocop/rubocop-minitest) and [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop-minitest` from 0.37.1 to 0.38.0 - [Release notes](https://github.com/rubocop/rubocop-minitest/releases) - [Changelog](https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-minitest/compare/v0.37.1...v0.38.0) Updates `rubocop` from 1.75.0 to 1.75.1 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.75.0...v1.75.1) --- updated-dependencies: - dependency-name: rubocop-minitest dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9eae1132..3801f200 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,7 +16,7 @@ GEM lint_roller (1.1.0) minitest (5.25.5) parallel (1.26.3) - parser (3.3.7.3) + parser (3.3.7.4) ast (~> 2.4.1) racc prism (1.4.0) @@ -24,7 +24,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) - rubocop (1.75.0) + rubocop (1.75.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -38,9 +38,9 @@ GEM rubocop-ast (1.43.0) parser (>= 3.3.7.2) prism (~> 1.4) - rubocop-minitest (0.37.1) + rubocop-minitest (0.38.0) lint_roller (~> 1.1) - rubocop (>= 1.72.1, < 2.0) + rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) rubocop-thread_safety (0.7.2) lint_roller (~> 1.1) From 37ca7c91e912d818c825e48d132008e8908a91b1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:23:38 +0000 Subject: [PATCH 081/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index ea96ba56..9a452749 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -3321,9 +3321,9 @@ Style/ItBlockParameter: Description: Checks for blocks with one argument where `it` block parameter can be used. Enabled: false - EnforcedStyle: allow_named_parameter + EnforcedStyle: only_numbered_parameters SupportedStyles: - - allow_named_parameter + - only_numbered_parameters - always - disallow VersionAdded: '1.75' From 159abba66ddfa745cc0b5c660a728423ab3959f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:50:08 +0000 Subject: [PATCH 082/112] Bump actions/setup-node from 4.3.0 to 4.4.0 in the actions group Bumps the actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 4.3.0 to 4.4.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4.3.0...v4.4.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- .github/workflows/node.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 45a80fdd..3eeb9d77 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.3.0 + uses: actions/setup-node@v4.4.0 with: node-version: '16' check-version: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 9704511a..cfe0434b 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v4.3.0 + uses: actions/setup-node@v4.4.0 with: node-version: '16' check-latest: true From 0766e333cab47f6fd19519581b666d08dac38c18 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Tue, 29 Apr 2025 22:01:32 -0400 Subject: [PATCH 083/112] update github actions to commits --- .github/workflows/dump-config.yml | 6 +++--- .github/workflows/github-pages.yml | 6 +++--- .github/workflows/labeler.yml | 2 +- .github/workflows/node.yml | 4 ++-- .github/workflows/ruby.yml | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index 0aa95be5..ac4575e1 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -22,13 +22,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.head_ref }} token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0 with: bundler-cache: true @@ -36,7 +36,7 @@ jobs: run: bundle exec rake config:dump - name: Commit & push - uses: EndBug/add-and-commit@v9 + uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 id: push with: add: 'test/fixtures/full_config.yml' diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 3eeb9d77..7a306b20 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Node.js environment - uses: actions/setup-node@v4.4.0 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '16' check-version: true @@ -25,7 +25,7 @@ jobs: run: npm run build - name: Deploy - uses: peaceiris/actions-gh-pages@v4.0.0 + uses: peaceiris/actions-gh-pages@47f197a2200bb9de68ba5f48fad1c088eb1c4a32 # v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_site diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 1495c947..906fc2dc 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,7 +9,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v5 + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index cfe0434b..7bdef15f 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Node.js environment - uses: actions/setup-node@v4.4.0 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '16' check-latest: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 6d48e519..a2c62e07 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -17,9 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From b92616c931e46ef7e9131ad4743873a61b74d816 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 15:09:01 +0000 Subject: [PATCH 084/112] Bump the actions group across 1 directory with 2 updates Bumps the actions group with 2 updates in the / directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby) and [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages). Updates `ruby/setup-ruby` from 1.235.0 to 1.237.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/dffc446db9ba5a0c4446edb5bca1c5c473a806c5...eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c) Updates `peaceiris/actions-gh-pages` from 47f197a2200bb9de68ba5f48fad1c088eb1c4a32 to 4f9cc6602d3f66b9c108549d475ec49e8ef4d45e - [Release notes](https://github.com/peaceiris/actions-gh-pages/releases) - [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-gh-pages/compare/47f197a2200bb9de68ba5f48fad1c088eb1c4a32...4f9cc6602d3f66b9c108549d475ec49e8ef4d45e) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.237.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: peaceiris/actions-gh-pages dependency-version: 4f9cc6602d3f66b9c108549d475ec49e8ef4d45e dependency-type: direct:production dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/github-pages.yml | 2 +- .github/workflows/ruby.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index ac4575e1..3a5c8891 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0 + uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 with: bundler-cache: true diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 7a306b20..de68b5c3 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -25,7 +25,7 @@ jobs: run: npm run build - name: Deploy - uses: peaceiris/actions-gh-pages@47f197a2200bb9de68ba5f48fad1c088eb1c4a32 # v4.0.0 + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_site diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a2c62e07..83bb5384 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0 + uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 8793a8b8d9ada20c8e8972fed372f6ffb611fd06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 15:59:24 +0000 Subject: [PATCH 085/112] Bump ruby/setup-ruby from 1.237.0 to 1.239.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.237.0 to 1.239.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c...84684c07c1965536eb4802c8daf1a77968df0cb1) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.239.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index 3a5c8891..dfca8626 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 + uses: ruby/setup-ruby@84684c07c1965536eb4802c8daf1a77968df0cb1 # v1.239.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 83bb5384..b1ad9cb6 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 + uses: ruby/setup-ruby@84684c07c1965536eb4802c8daf1a77968df0cb1 # v1.239.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 6f0abd599783f8f1311ec0077972e0461f7541bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 15:30:58 +0000 Subject: [PATCH 086/112] Bump ruby/setup-ruby from 1.239.0 to 1.240.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.239.0 to 1.240.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/84684c07c1965536eb4802c8daf1a77968df0cb1...1a0ff446f5856bdfec298b61a09727c860d9d480) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.240.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index dfca8626..43801894 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@84684c07c1965536eb4802c8daf1a77968df0cb1 # v1.239.0 + uses: ruby/setup-ruby@1a0ff446f5856bdfec298b61a09727c860d9d480 # v1.240.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index b1ad9cb6..45275b97 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@84684c07c1965536eb4802c8daf1a77968df0cb1 # v1.239.0 + uses: ruby/setup-ruby@1a0ff446f5856bdfec298b61a09727c860d9d480 # v1.240.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 1f4bfd0a6df3ca5536c1952a3606d1ce40db7632 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 15:58:31 +0000 Subject: [PATCH 087/112] Bump ruby/setup-ruby from 1.240.0 to 1.242.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.240.0 to 1.242.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/1a0ff446f5856bdfec298b61a09727c860d9d480...cb0fda56a307b8c78d38320cd40d9eb22a3bf04e) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.242.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index 43801894..ea32e5ca 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@1a0ff446f5856bdfec298b61a09727c860d9d480 # v1.240.0 + uses: ruby/setup-ruby@cb0fda56a307b8c78d38320cd40d9eb22a3bf04e # v1.242.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 45275b97..b6948600 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@1a0ff446f5856bdfec298b61a09727c860d9d480 # v1.240.0 + uses: ruby/setup-ruby@cb0fda56a307b8c78d38320cd40d9eb22a3bf04e # v1.242.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 9bec4cf9ad4354e7a2c33deb5a1d5637a37d2244 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 15:32:08 +0000 Subject: [PATCH 088/112] Bump ruby/setup-ruby from 1.242.0 to 1.244.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.242.0 to 1.244.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/cb0fda56a307b8c78d38320cd40d9eb22a3bf04e...13e7a03dc3ac6c3798f4570bfead2aed4d96abfb) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.244.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index ea32e5ca..f99c21e8 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@cb0fda56a307b8c78d38320cd40d9eb22a3bf04e # v1.242.0 + uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index b6948600..7d352d9c 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@cb0fda56a307b8c78d38320cd40d9eb22a3bf04e # v1.242.0 + uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From d62c33bd6f5b6801d8249f315053dcd2d59be961 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Wed, 21 May 2025 13:10:50 -0400 Subject: [PATCH 089/112] Only update GitHub Actions weekly `ruby/setup-ruby` has had lots of updates recently. We don't really need to be updating it daily though. --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7be023fd..01174d63 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,7 +19,7 @@ updates: - package-ecosystem: github-actions directory: '/' schedule: - interval: daily + interval: weekly groups: actions: patterns: From c1a929b0eb9061570003846b9e6390e0287abcf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 15:38:31 +0000 Subject: [PATCH 090/112] Bump rake from 13.2.1 to 13.3.0 Bumps [rake](https://github.com/ruby/rake) from 13.2.1 to 13.3.0. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) --- updated-dependencies: - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3801f200..0fe0b9e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,7 +22,7 @@ GEM prism (1.4.0) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.0) regexp_parser (2.10.0) rubocop (1.75.1) json (~> 2.3) From bac0c0c33b70fb9af2a53c791298a25d5354061d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:28:22 +0000 Subject: [PATCH 091/112] Bump the rubocop group with 2 updates Bumps the rubocop group with 2 updates: [rubocop-minitest](https://github.com/rubocop/rubocop-minitest) and [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop-minitest` from 0.38.0 to 0.38.1 - [Release notes](https://github.com/rubocop/rubocop-minitest/releases) - [Changelog](https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-minitest/compare/v0.38.0...v0.38.1) Updates `rubocop` from 1.75.1 to 1.75.8 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.75.1...v1.75.8) --- updated-dependencies: - dependency-name: rubocop-minitest dependency-version: 0.38.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rubocop - dependency-name: rubocop dependency-version: 1.75.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0fe0b9e2..681746c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,12 +11,12 @@ GEM specs: ast (2.4.3) diffy (3.4.3) - json (2.10.2) - language_server-protocol (3.17.0.4) + json (2.12.2) + language_server-protocol (3.17.0.5) lint_roller (1.1.0) minitest (5.25.5) - parallel (1.26.3) - parser (3.3.7.4) + parallel (1.27.0) + parser (3.3.8.0) ast (~> 2.4.1) racc prism (1.4.0) @@ -24,7 +24,7 @@ GEM rainbow (3.1.1) rake (13.3.0) regexp_parser (2.10.0) - rubocop (1.75.1) + rubocop (1.75.8) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -32,13 +32,13 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.43.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.43.0) + rubocop-ast (1.44.1) parser (>= 3.3.7.2) prism (~> 1.4) - rubocop-minitest (0.38.0) + rubocop-minitest (0.38.1) lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) From a4e83ba72c1e48533ea9537ab0abb45caf9919dd Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:28:55 +0000 Subject: [PATCH 092/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 49 ++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 9a452749..0a5972a3 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -188,7 +188,8 @@ Bundler/OrderedGems: Gemspec/AddRuntimeDependency: Description: Prefer `add_dependency` over `add_runtime_dependency`. StyleGuide: "#add_dependency_vs_add_runtime_dependency" - Reference: https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316 + References: + - https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316 Enabled: false VersionAdded: '1.65' Include: @@ -252,7 +253,7 @@ Gemspec/RequireMFA: Severity: warning VersionAdded: '1.23' VersionChanged: '1.40' - Reference: + References: - https://guides.rubygems.org/mfa-requirement-opt-in/ Include: - "**/*.gemspec" @@ -432,7 +433,7 @@ Layout/EmptyLineAfterMultilineCondition: Description: Enforces empty line after multiline condition. Enabled: false VersionAdded: '0.90' - Reference: + References: - https://github.com/airbnb/ruby#multiline-if-newline Layout/EmptyLineBetweenDefs: Description: Use empty lines between class/module/method defs. @@ -460,7 +461,7 @@ Layout/EmptyLinesAroundAccessModifier: SupportedStyles: - around - only_before - Reference: + References: - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions Layout/EmptyLinesAroundArguments: Description: Keeps track of empty lines around method arguments. @@ -664,7 +665,7 @@ Layout/IndentationConsistency: SupportedStyles: - normal - indented_internal_methods - Reference: + References: - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions Layout/IndentationStyle: Description: Consistent indentation either with tabs only or spaces only. @@ -1478,7 +1479,8 @@ Lint/InterpolationCheck: VersionChanged: '1.40' Lint/ItWithoutArgumentsInBlock: Description: Checks uses of `it` calls without arguments in block. - Reference: https://bugs.ruby-lang.org/issues/18980 + References: + - https://bugs.ruby-lang.org/issues/18980 Enabled: false VersionAdded: '1.59' Lint/LambdaWithoutLiteralBlock: @@ -2004,7 +2006,7 @@ Lint/Void: Metrics/AbcSize: Description: A calculated magnitude based on number of assignments, branches, and conditions. - Reference: + References: - http://c2.com/cgi/wiki?AbcMetric - https://en.wikipedia.org/wiki/ABC_Software_Metric Enabled: false @@ -2389,7 +2391,8 @@ Security/IoMethods: Security/JSONLoad: Description: Prefer usage of `JSON.parse` over `JSON.load` due to potential security issues. See reference for more information. - Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load + References: + - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load Enabled: false VersionAdded: '0.43' VersionChanged: '1.22' @@ -2397,7 +2400,8 @@ Security/JSONLoad: Security/MarshalLoad: Description: Avoid using of `Marshal.load` or `Marshal.restore` due to potential security issues. See reference for more information. - Reference: https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations + References: + - https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations Enabled: false VersionAdded: '0.47' Security/Open: @@ -2410,7 +2414,8 @@ Security/Open: Security/YAMLLoad: Description: Prefer usage of `YAML.safe_load` over `YAML.load` due to potential security issues. See reference for more information. - Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security + References: + - https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security Enabled: false VersionAdded: '0.47' SafeAutoCorrect: false @@ -2490,7 +2495,8 @@ Style/ArrayCoercion: VersionAdded: '0.88' Style/ArrayFirstLast: Description: Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`. - Reference: "#first-and-last" + References: + - "#first-and-last" Enabled: false VersionAdded: '1.58' Safe: false @@ -2759,7 +2765,9 @@ Style/CommentedKeyword: Style/ComparableBetween: Description: Enforces the use of `Comparable#between?` instead of logical comparison. Enabled: false + Safe: false VersionAdded: '1.74' + VersionChanged: '1.75' StyleGuide: "#ranges-or-between" Style/ComparableClamp: Description: Enforces the use of `Comparable#clamp` instead of comparison by minimum @@ -3003,7 +3011,7 @@ Style/ExponentialNotation: - integral Style/FetchEnvVar: Description: Suggests `ENV.fetch` for the replacement of `ENV[]`. - Reference: + References: - https://rubystyle.guide/#hash-fetch-defaults Enabled: false VersionAdded: '1.28' @@ -3037,7 +3045,8 @@ Style/FileWrite: Style/FloatDivision: Description: For performing float division, coerce one side only. StyleGuide: "#float-division" - Reference: https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html + References: + - https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html Enabled: false VersionAdded: '0.72' VersionChanged: '1.9' @@ -3110,7 +3119,8 @@ Style/GlobalStdStream: Style/GlobalVars: Description: Do not introduce global variables. StyleGuide: "#instance-vars" - Reference: https://www.zenspider.com/ruby/quickref.html + References: + - https://www.zenspider.com/ruby/quickref.html Enabled: false VersionAdded: '0.13' AllowedVariables: [] @@ -3751,7 +3761,7 @@ Style/OneLineConditional: Style/OpenStructUse: Description: Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance, version compatibility, and potential security issues. - Reference: + References: - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats Enabled: false Safe: false @@ -3950,7 +3960,8 @@ Style/RedundantFetchBlock: Description: Use `fetch(key, value)` instead of `fetch(key) { value }` when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant. - Reference: https://github.com/fastruby/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code + References: + - https://github.com/fastruby/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code Enabled: false Safe: false SafeForConstants: false @@ -4145,7 +4156,8 @@ Style/SafeNavigationChainLength: Max: 2 Style/Sample: Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`. - Reference: https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code + References: + - https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code Enabled: false VersionAdded: '0.30' Style/SelectByRegexp: @@ -4533,7 +4545,8 @@ Style/YAMLFileRead: VersionAdded: '1.53' Style/YodaCondition: Description: Forbid or enforce yoda conditions. - Reference: https://en.wikipedia.org/wiki/Yoda_conditions + References: + - https://en.wikipedia.org/wiki/Yoda_conditions Enabled: false EnforcedStyle: forbid_for_all_comparison_operators SupportedStyles: From fdff86c0950b58886a69da72de0a347ccfd72362 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:36:38 +0000 Subject: [PATCH 093/112] Bump rubocop from 1.75.8 to 1.76.0 in the rubocop group Bumps the rubocop group with 1 update: [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop` from 1.75.8 to 1.76.0 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.75.8...v1.76.0) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.76.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 ++-- test/fixtures/full_config.yml | 58 ++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 681746c1..655fed4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,7 +24,7 @@ GEM rainbow (3.1.1) rake (13.3.0) regexp_parser (2.10.0) - rubocop (1.75.8) + rubocop (1.76.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -32,10 +32,10 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.45.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.45.0) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-minitest (0.38.1) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 0a5972a3..4ca6ec94 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1387,7 +1387,7 @@ Lint/EmptyInterpolation: Enabled: true AutoCorrect: contextual VersionAdded: '0.20' - VersionChanged: '1.61' + VersionChanged: '1.76' Lint/EmptyWhen: Description: Checks for `when` branches with empty bodies. Enabled: false @@ -1794,6 +1794,7 @@ Lint/ShadowingOuterLocalVariable: or block local variables. Enabled: false VersionAdded: '0.9' + VersionChanged: '1.76' Lint/SharedMutableDefault: Description: Checks for mutable literals used as default arguments during Hash initialization. StyleGuide: "#no-mutable-defaults" @@ -1954,6 +1955,13 @@ Lint/UselessConstantScoping: Description: Checks for useless constant scoping. Enabled: false VersionAdded: '1.72' +Lint/UselessDefaultValueArgument: + Description: Checks for usage of `fetch` or `Array.new` with default value argument + and block. + Enabled: pending + VersionAdded: '1.76' + Safe: false + AllowedReceivers: [] Lint/UselessDefined: Description: Checks for calls to `defined?` with strings and symbols. The result of such a call will always be truthy. @@ -1975,6 +1983,10 @@ Lint/UselessNumericOperation: Description: Checks for useless numeric operations. Enabled: false VersionAdded: '1.66' +Lint/UselessOr: + Description: Checks for useless OR expressions. + Enabled: pending + VersionAdded: '1.76' Lint/UselessRescue: Description: Checks for useless `rescue`s. Enabled: false @@ -2309,16 +2321,30 @@ Naming/MethodParameterName: - pp - to ForbiddenNames: [] -Naming/PredicateName: - Description: Check the names of predicate methods. +Naming/PredicateMethod: + Description: Checks that predicate methods end with `?` and non-predicate methods + do not. + Enabled: pending + VersionAdded: '1.76' + Mode: conservative + AllowedMethods: + - call +Naming/PredicatePrefix: + Description: Predicate method names should not be prefixed and end with a `?`. StyleGuide: "#bool-methods-qmark" - Enabled: false + Enabled: true VersionAdded: '0.50' VersionChanged: '1.75' NamePrefix: - is_ + - has_ + - have_ + - does_ ForbiddenPrefixes: - is_ + - has_ + - have_ + - does_ AllowedMethods: - is_a? MethodDefinitionMacros: @@ -2943,6 +2969,15 @@ Style/EmptyMethod: SupportedStyles: - compact - expanded +Style/EmptyStringInsideInterpolation: + Description: Checks for empty strings being assigned inside string interpolation. + StyleGuide: "#empty-strings-in-interpolation" + Enabled: pending + EnforcedStyle: trailing_conditional + SupportedStyles: + - trailing_conditional + - ternary + VersionAdded: '1.76' Style/Encoding: Description: Use UTF-8 as the source file encoding. StyleGuide: "#utf-8" @@ -3331,12 +3366,14 @@ Style/ItBlockParameter: Description: Checks for blocks with one argument where `it` block parameter can be used. Enabled: false - EnforcedStyle: only_numbered_parameters + EnforcedStyle: allow_single_line SupportedStyles: + - allow_single_line - only_numbered_parameters - always - disallow VersionAdded: '1.75' + VersionChanged: '1.76' Style/KeywordArgumentsMerging: Description: When passing an existing hash as keyword arguments, provide additional arguments directly rather than using `merge`. @@ -3908,6 +3945,11 @@ Style/RedundantArrayConstructor: Description: Checks for the instantiation of array using redundant `Array` constructor. Enabled: false VersionAdded: '1.52' +Style/RedundantArrayFlatten: + Description: Checks for redundant calls of `Array#flatten`. + Enabled: pending + Safe: false + VersionAdded: '1.76' Style/RedundantAssignment: Description: Checks for redundant assignment before returning. Enabled: false @@ -4616,3 +4658,9 @@ inherit_mode: merge: - Exclude - Include +Naming/PredicateName: + Enabled: false + NamePrefix: + - is_ + ForbiddenPrefixes: + - is_ From ee416ca43e62cd9ad5d53124e09d008506bfad4a Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 11:46:48 -0400 Subject: [PATCH 094/112] Handle `Naming/Predicate{Naming,Prefix}` rename This cop has been renamed, so we conditionally set the config depending on RuboCop version. --- rubocop.yml | 4 ++++ test/fixtures/full_config.yml | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index cb49108d..fe6a7fda 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -558,7 +558,11 @@ Naming/MethodName: Naming/MethodParameterName: Enabled: false +<% if rubocop_version >= "1.76" %> +Naming/PredicatePrefix: +<% else %> Naming/PredicateName: +<% end %> Enabled: false NamePrefix: - is_ diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 4ca6ec94..c5a7edfa 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2332,19 +2332,13 @@ Naming/PredicateMethod: Naming/PredicatePrefix: Description: Predicate method names should not be prefixed and end with a `?`. StyleGuide: "#bool-methods-qmark" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.75' NamePrefix: - is_ - - has_ - - have_ - - does_ ForbiddenPrefixes: - is_ - - has_ - - have_ - - does_ AllowedMethods: - is_a? MethodDefinitionMacros: @@ -4658,9 +4652,3 @@ inherit_mode: merge: - Exclude - Include -Naming/PredicateName: - Enabled: false - NamePrefix: - - is_ - ForbiddenPrefixes: - - is_ From 16502a2dee45917138293c0acae2f679672a2a07 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:00:03 -0400 Subject: [PATCH 095/112] Support `dev test` --- dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev.yml b/dev.yml index 1fd373ab..d551f7f6 100644 --- a/dev.yml +++ b/dev.yml @@ -1,3 +1,5 @@ up: - ruby - bundler + +test: bundle exec rake From 487ed0fc1fd364d2ac053afb870219ff2aaa982e Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:00:20 -0400 Subject: [PATCH 096/112] Conditionally configure `Lint/ShadowingOuterLocalVariable` As of `rubocop@1.76`, our config matches the default, so we should not configure it. --- rubocop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index fe6a7fda..27963f33 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -378,8 +378,10 @@ Lint/ShadowedArgument: Lint/ShadowedException: Enabled: false +<% if rubocop_version < "1.76" %> Lint/ShadowingOuterLocalVariable: Enabled: false +<% end %> Lint/SharedMutableDefault: Enabled: false From a6ad200ac8fef7fc9f4c0437e2432b935a1f57de Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:01:46 -0400 Subject: [PATCH 097/112] Enable pending `Lint/UselessDefaultValueArgument` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 27963f33..97c6d8af 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -452,6 +452,11 @@ Lint/UselessAssignment: Lint/UselessConstantScoping: Enabled: false +<% if rubocop_version >= "1.76" %> +Lint/UselessDefaultValueArgument: + Enabled: true +<% end %> + Lint/UselessDefined: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index c5a7edfa..9c49f1fc 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1958,7 +1958,7 @@ Lint/UselessConstantScoping: Lint/UselessDefaultValueArgument: Description: Checks for usage of `fetch` or `Array.new` with default value argument and block. - Enabled: pending + Enabled: true VersionAdded: '1.76' Safe: false AllowedReceivers: [] From 0e9597fd5af6c96e74831c756407eee0d3b4a157 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:02:05 -0400 Subject: [PATCH 098/112] Enable pending `Lint/UselessOr` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 97c6d8af..a0d7fde2 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -469,6 +469,11 @@ Lint/UselessMethodDefinition: Lint/UselessNumericOperation: Enabled: false +<% if rubocop_version >= "1.76" %> +Lint/UselessOr: + Enabled: true +<% end %> + Lint/UselessRescue: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 9c49f1fc..624038dd 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1985,7 +1985,7 @@ Lint/UselessNumericOperation: VersionAdded: '1.66' Lint/UselessOr: Description: Checks for useless OR expressions. - Enabled: pending + Enabled: true VersionAdded: '1.76' Lint/UselessRescue: Description: Checks for useless `rescue`s. From 89cd2220c8939561f2ce65941f6b4dc080ef32d8 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:02:29 -0400 Subject: [PATCH 099/112] Disable pending `Naming/PredicateMethod` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index a0d7fde2..33219cbd 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -570,6 +570,11 @@ Naming/MethodName: Naming/MethodParameterName: Enabled: false +<% if rubocop_version >= "1.76" %> +Naming/PredicateMethod: + Enabled: false +<% end %> + <% if rubocop_version >= "1.76" %> Naming/PredicatePrefix: <% else %> diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 624038dd..1234a435 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2324,7 +2324,7 @@ Naming/MethodParameterName: Naming/PredicateMethod: Description: Checks that predicate methods end with `?` and non-predicate methods do not. - Enabled: pending + Enabled: false VersionAdded: '1.76' Mode: conservative AllowedMethods: From b8232718d85247d8766fa700e8541a0d54928e66 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:02:48 -0400 Subject: [PATCH 100/112] Disable pending `Style/EmptyStringInsideInterpolation` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 33219cbd..e601320c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -789,6 +789,11 @@ Style/EmptyLiteral: Style/EmptyMethod: Enabled: false +<% if rubocop_version >= "1.76" %> +Style/EmptyStringInsideInterpolation: + Enabled: false +<% end %> + Style/Encoding: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 1234a435..732f9c37 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2966,7 +2966,7 @@ Style/EmptyMethod: Style/EmptyStringInsideInterpolation: Description: Checks for empty strings being assigned inside string interpolation. StyleGuide: "#empty-strings-in-interpolation" - Enabled: pending + Enabled: false EnforcedStyle: trailing_conditional SupportedStyles: - trailing_conditional From ccbb378d69d4240533337884f1446d0779c117ce Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:03:04 -0400 Subject: [PATCH 101/112] Enable pending `Style/ReduntantArrayFlatten` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index e601320c..bb987db2 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1138,6 +1138,11 @@ Style/RedundantArgument: Style/RedundantArrayConstructor: Enabled: false +<% if rubocop_version >= "1.76" %> +Style/RedundantArrayFlatten: + Enabled: true +<% end %> + Style/RedundantAssignment: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 732f9c37..e7b63f15 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -3941,7 +3941,7 @@ Style/RedundantArrayConstructor: VersionAdded: '1.52' Style/RedundantArrayFlatten: Description: Checks for redundant calls of `Array#flatten`. - Enabled: pending + Enabled: true Safe: false VersionAdded: '1.76' Style/RedundantAssignment: From fa20e328c59f8000975a09cce71c67bbd32eb504 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 15:07:06 +0000 Subject: [PATCH 102/112] Bump diffy from 3.4.3 to 3.4.4 Bumps [diffy](https://github.com/samg/diffy) from 3.4.3 to 3.4.4. - [Changelog](https://github.com/samg/diffy/blob/main/CHANGELOG) - [Commits](https://github.com/samg/diffy/commits) --- updated-dependencies: - dependency-name: diffy dependency-version: 3.4.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 655fed4c..61a87482 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,7 +10,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - diffy (3.4.3) + diffy (3.4.4) json (2.12.2) language_server-protocol (3.17.0.5) lint_roller (1.1.0) From 40cbc06fb30e7b6d0a356afdb0682f7fb44f79c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 17:03:13 +0000 Subject: [PATCH 103/112] Bump ruby/setup-ruby from 1.244.0 to 1.245.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.244.0 to 1.245.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/13e7a03dc3ac6c3798f4570bfead2aed4d96abfb...a4effe49ee8ee5b8b5091268c473a4628afb5651) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.245.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index f99c21e8..e9895054 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 7d352d9c..1be75819 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 6a66c37a168f0338b491fa5d60ae91de72bd65c0 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 19 Jun 2025 14:47:06 -0400 Subject: [PATCH 104/112] Remove `rubocop-thread_safety` After evaluating this plugin against real code, we have decided it is not worth including in this gem. Consumers can manually configure it as desired. --- Gemfile.lock | 4 ---- rubocop-shopify.gemspec | 1 - rubocop.yml | 12 ------------ test/fixtures/full_config.yml | 32 -------------------------------- 4 files changed, 49 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 61a87482..ee009b56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,6 @@ PATH rubocop-shopify (3.0.0) lint_roller rubocop (~> 1.72, >= 1.72.1) - rubocop-thread_safety (>= 0.7.1) GEM remote: https://rubygems.org/ @@ -42,9 +41,6 @@ GEM lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) - rubocop-thread_safety (0.7.2) - lint_roller (~> 1.1) - rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index e1750aa8..52db0165 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -30,6 +30,5 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 3.2.0" s.add_dependency("rubocop", "~> 1.72", ">= 1.72.1") - s.add_dependency("rubocop-thread_safety", ">= 0.7.1") s.add_dependency("lint_roller") end diff --git a/rubocop.yml b/rubocop.yml index bb987db2..90a3c1f3 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -4,7 +4,6 @@ plugins: - rubocop-shopify - - rubocop-thread_safety inherit_mode: merge: @@ -1406,14 +1405,3 @@ Style/YodaCondition: Style/ZeroLengthPredicate: Enabled: false -ThreadSafety/ClassInstanceVariable: - Enabled: false - -ThreadSafety/MutableClassInstanceVariable: - Enabled: false - -ThreadSafety/NewThread: - Enabled: false - -ThreadSafety/RackMiddlewareInstanceVariable: - Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index e7b63f15..0777c9af 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -4616,38 +4616,6 @@ Lint/NoReturnInMemoization: VersionAdded: 3.0.0 Description: Checks for the use of a `return` with a value in `begin..end` blocks in the context of instance variable assignment such as memoization. -ThreadSafety/ClassAndModuleAttributes: - Description: Avoid mutating class and module attributes. - Enabled: true - ActiveSupportClassAttributeAllowed: false -ThreadSafety/ClassInstanceVariable: - Description: Avoid class instance variables. - Enabled: false -ThreadSafety/MutableClassInstanceVariable: - Description: Do not assign mutable objects to class instance variables. - Enabled: false - EnforcedStyle: literals - SafeAutoCorrect: false - SupportedStyles: - - literals - - strict -ThreadSafety/NewThread: - Description: Avoid starting new threads. Let a framework like Sidekiq handle the - threads. - Enabled: false -ThreadSafety/DirChdir: - Description: Avoid using `Dir.chdir` due to its process-wide effect. - Enabled: true - AllowCallWithBlock: false -ThreadSafety/RackMiddlewareInstanceVariable: - Description: Avoid instance variables in Rack middleware. - Enabled: false - Include: - - app/middleware/**/*.rb - - lib/middleware/**/*.rb - - app/middlewares/**/*.rb - - lib/middlewares/**/*.rb - AllowedIdentifiers: [] inherit_mode: merge: - Exclude From 81bef691b23e73680e45975628c80825e9392006 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 16:07:27 +0000 Subject: [PATCH 105/112] Bump rubocop in the rubocop group across 1 directory Bumps the rubocop group with 1 update in the / directory: [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop` from 1.76.0 to 1.77.0 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.76.0...v1.77.0) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.77.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- test/fixtures/full_config.yml | 22 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ee009b56..089d30ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,7 +23,7 @@ GEM rainbow (3.1.1) rake (13.3.0) regexp_parser (2.10.0) - rubocop (1.76.0) + rubocop (1.77.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -31,10 +31,10 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.45.0, < 2.0) + rubocop-ast (>= 1.45.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.45.0) + rubocop-ast (1.45.1) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-minitest (0.38.1) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 0777c9af..74c37923 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -194,6 +194,12 @@ Gemspec/AddRuntimeDependency: VersionAdded: '1.65' Include: - "**/*.gemspec" +Gemspec/AttributeAssignment: + Description: Use consistent style for Gemspec attributes assignment. + Enabled: pending + VersionAdded: '1.77' + Include: + - "**/*.gemspec" Gemspec/DependencyVersion: Description: Requires or forbids specifying gem dependency versions. Enabled: false @@ -742,6 +748,7 @@ Layout/LineLength: Max: 120 AllowHeredoc: true AllowURI: true + AllowQualifiedName: true URISchemes: - http - https @@ -1776,6 +1783,7 @@ Lint/SelfAssignment: Description: Checks for self-assignments. Enabled: true VersionAdded: '0.89' + AllowRBSInlineAnnotation: false Lint/SendWithMixinArgument: Description: Checks for `send` method when using mixin. Enabled: true @@ -2019,7 +2027,7 @@ Metrics/AbcSize: Description: A calculated magnitude based on number of assignments, branches, and conditions. References: - - http://c2.com/cgi/wiki?AbcMetric + - https://wiki.c2.com/?AbcMetric - https://en.wikipedia.org/wiki/ABC_Software_Metric Enabled: false VersionAdded: '0.27' @@ -2326,9 +2334,12 @@ Naming/PredicateMethod: do not. Enabled: false VersionAdded: '1.76' + VersionChanged: '1.76' Mode: conservative AllowedMethods: - call + AllowedPatterns: [] + AllowBangMethods: false Naming/PredicatePrefix: Description: Predicate method names should not be prefixed and end with a `?`. StyleGuide: "#bool-methods-qmark" @@ -2729,6 +2740,12 @@ Style/CollectionMethods: MethodsAcceptingSymbol: - inject - reduce +Style/CollectionQuerying: + Description: Prefer `Enumerable` predicate methods over expressions with `count`. + StyleGuide: "#collection-querying" + Enabled: pending + VersionAdded: '1.77' + Safe: false Style/ColonMethodCall: Description: 'Do not use :: for method call.' StyleGuide: "#double-colons" @@ -3045,6 +3062,7 @@ Style/FetchEnvVar: Enabled: false VersionAdded: '1.28' AllowedVars: [] + DefaultToNil: true Style/FileEmpty: Description: Prefer to use `File.empty?('path/to/file')` when checking if a file is empty. @@ -3793,7 +3811,7 @@ Style/OpenStructUse: Description: Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance, version compatibility, and potential security issues. References: - - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats + - https://docs.ruby-lang.org/en/3.0/OpenStruct.html#class-OpenStruct-label-Caveats Enabled: false Safe: false VersionAdded: '1.23' From 616c4fab8eeb0d2e8cebaee2eec5867d1572c2e2 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 23 Jun 2025 10:55:52 -0400 Subject: [PATCH 106/112] Enable `Gemspec/AttributeAssignment` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 90a3c1f3..92501d3f 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -23,6 +23,11 @@ Bundler/OrderedGems: Gemspec/AddRuntimeDependency: Enabled: false +<% if rubocop_version >= '1.77' %> +Gemspec/AttributeAssignment: + Enabled: true +<% end %> + Gemspec/DeprecatedAttributeAssignment: Enabled: true diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 74c37923..34b73973 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -196,7 +196,7 @@ Gemspec/AddRuntimeDependency: - "**/*.gemspec" Gemspec/AttributeAssignment: Description: Use consistent style for Gemspec attributes assignment. - Enabled: pending + Enabled: true VersionAdded: '1.77' Include: - "**/*.gemspec" From f92b33249d052cb242ace41d81cd3e203f1e7bb6 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 23 Jun 2025 10:56:30 -0400 Subject: [PATCH 107/112] Enable `Style/CollectionQuerying` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 92501d3f..444d06ad 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -702,6 +702,11 @@ Style/ClassVars: Style/CollectionCompact: Enabled: false +<% if rubocop_version >= '1.77' %> +Style/CollectionQuerying: + Enabled: true +<% end %> + Style/ColonMethodCall: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 34b73973..7df90d96 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2743,7 +2743,7 @@ Style/CollectionMethods: Style/CollectionQuerying: Description: Prefer `Enumerable` predicate methods over expressions with `count`. StyleGuide: "#collection-querying" - Enabled: pending + Enabled: true VersionAdded: '1.77' Safe: false Style/ColonMethodCall: From 37e782e7bce0e754342bf899d029e433555df731 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 15:08:25 +0000 Subject: [PATCH 108/112] Bump rubocop from 1.77.0 to 1.78.0 in the rubocop group Bumps the rubocop group with 1 update: [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop` from 1.77.0 to 1.78.0 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.77.0...v1.78.0) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.78.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 089d30ce..43b5dfa0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,7 +23,7 @@ GEM rainbow (3.1.1) rake (13.3.0) regexp_parser (2.10.0) - rubocop (1.77.0) + rubocop (1.78.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) From ddaf508617c0e3dbef7b42869b46a44b3039e8f1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 15:09:11 +0000 Subject: [PATCH 109/112] Dump full RuboCop config This automated commit dumps the contents of the full RuboCop config. [dependabot skip] --- test/fixtures/full_config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 7df90d96..36f0e545 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2334,12 +2334,14 @@ Naming/PredicateMethod: do not. Enabled: false VersionAdded: '1.76' - VersionChanged: '1.76' + VersionChanged: '1.78' Mode: conservative AllowedMethods: - call AllowedPatterns: [] AllowBangMethods: false + WaywardPredicates: + - nonzero? Naming/PredicatePrefix: Description: Predicate method names should not be prefixed and end with a `?`. StyleGuide: "#bool-methods-qmark" From 14e8a8ed8df4bd8cf1a8a02cbe7985b122bae789 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 17:01:38 +0000 Subject: [PATCH 110/112] Bump ruby/setup-ruby from 1.245.0 to 1.247.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.245.0 to 1.247.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/a4effe49ee8ee5b8b5091268c473a4628afb5651...472790540115ce5bd69d399a020189a8c87d641f) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.247.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index e9895054..2a833a8f 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 + uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # v1.247.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1be75819..e19b7aa2 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 + uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # v1.247.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 080d1e959a19813064a3c21766830f9e8bd0f9a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 21:37:00 +0000 Subject: [PATCH 111/112] Bump ruby/setup-ruby from 1.247.0 to 1.253.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.247.0 to 1.253.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/472790540115ce5bd69d399a020189a8c87d641f...bb6434c747fa7022e12fa1cae2a0951fcffcff26) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.253.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index 2a833a8f..bb6d5d57 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # v1.247.0 + uses: ruby/setup-ruby@bb6434c747fa7022e12fa1cae2a0951fcffcff26 # v1.253.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index e19b7aa2..1d05706e 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # v1.247.0 + uses: ruby/setup-ruby@bb6434c747fa7022e12fa1cae2a0951fcffcff26 # v1.253.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 0bdc6d4a78e2fc957652557a98ac10f1fab0300a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:57:02 +0000 Subject: [PATCH 112/112] Bump ruby/setup-ruby from 1.253.0 to 1.254.0 in the actions group Bumps the actions group with 1 update: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.253.0 to 1.254.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/bb6434c747fa7022e12fa1cae2a0951fcffcff26...2a7b30092b0caf9c046252510f9273b4875f3db9) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.254.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dump-config.yml | 2 +- .github/workflows/ruby.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dump-config.yml b/.github/workflows/dump-config.yml index bb6d5d57..bd2c42ab 100644 --- a/.github/workflows/dump-config.yml +++ b/.github/workflows/dump-config.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - name: Setup Ruby - uses: ruby/setup-ruby@bb6434c747fa7022e12fa1cae2a0951fcffcff26 # v1.253.0 + uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0 with: bundler-cache: true diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1d05706e..58543e66 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby@bb6434c747fa7022e12fa1cae2a0951fcffcff26 # v1.253.0 + uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true