From 239e50cea54bc46c9beb9e8e5413c5192da3e900 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 00:19:11 +0000 Subject: [PATCH 1/4] Bump rubocop from 1.45.1 to 1.48.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.45.1 to 1.48.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.45.1...v1.48.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, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0a7260b1..56e98601 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,19 +27,19 @@ GEM rake (13.0.6) regexp_parser (2.7.0) rexml (3.2.5) - rubocop (1.45.1) + rubocop (1.48.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.26.0) + rubocop-ast (1.27.0) parser (>= 3.2.1.0) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) unicode-display_width (2.4.2) PLATFORMS From 48e7e88f85149f0ee6abc3d892b47ad5bf15f080 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 7 Mar 2023 13:40:12 -0500 Subject: [PATCH 2/4] Dump config --- test/fixtures/full_config.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 1122ba8f..fa52cc10 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -92,6 +92,8 @@ AllCops: - rake rubocop-graphql: - graphql + rubocop-capybara: + - capybara ActiveSupportExtensionsEnabled: false Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. @@ -1143,11 +1145,10 @@ Lint/Debugger: Description: Check for debugger calls. Enabled: true VersionAdded: '0.14' - VersionChanged: '1.10' + VersionChanged: '1.46' DebuggerMethods: Kernel: - binding.irb - - p - Kernel.binding.irb Byebug: - byebug @@ -1157,9 +1158,6 @@ Lint/Debugger: Capybara: - save_and_open_page - save_and_open_screenshot - PP: - - PP.pp - - pp debug.rb: - binding.b - binding.break @@ -1895,6 +1893,11 @@ Metrics/ClassLength: CountComments: false Max: 100 CountAsOne: [] +Metrics/CollectionLiteralLength: + Description: Checks for `Array` or `Hash` literals with many entries. + Enabled: pending + VersionAdded: '1.47' + LengthThreshold: 250 Metrics/CyclomaticComplexity: Description: A complexity metric that is strongly correlated to the number of test cases needed to validate a method. @@ -2212,6 +2215,7 @@ Naming/VariableNumber: - rfc822 - rfc2822 - rfc3339 + - x86_64 AllowedPatterns: [] Security/CompoundHash: Description: When overwriting Object#hash to combine values, prefer delegating to @@ -2313,6 +2317,7 @@ Style/ArrayCoercion: Style/ArrayIntersect: Description: Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`. Enabled: true + Safe: false VersionAdded: '1.40' Style/ArrayJoin: Description: Use Array#join instead of Array#*. @@ -2415,6 +2420,8 @@ Style/CaseLikeIf: Enabled: false Safe: false VersionAdded: '0.88' + VersionChanged: '1.48' + MinBranchesCount: 3 Style/CharacterLiteral: Description: Checks for uses of character literals. StyleGuide: "#no-character-literals" @@ -2598,6 +2605,11 @@ Style/Dir: to the current file. Enabled: false VersionAdded: '0.50' +Style/DirEmpty: + Description: Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory + is empty. + Enabled: pending + VersionAdded: '1.48' Style/DisableCopsWithinSourceCodeDirective: Description: Forbids disabling/enabling cops within source code. Enabled: false @@ -2761,6 +2773,13 @@ Style/FetchEnvVar: Enabled: false VersionAdded: '1.28' AllowedVars: [] +Style/FileEmpty: + Description: Prefer to use `File.empty?('path/to/file')` when checking if a file + is empty. + Enabled: pending + Safe: false + SafeAutoCorrect: false + VersionAdded: '1.48' Style/FileRead: Description: Favor `File.(bin)read` convenience methods. StyleGuide: "#file-read" From e2c0d423ca0585c5870d5ca7523539bdb15befa2 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 7 Mar 2023 13:41:25 -0500 Subject: [PATCH 3/4] Enable `Metrics/CollectionLiteralLength` --- Gemfile.lock | 2 +- rubocop-shopify.gemspec | 2 +- rubocop.yml | 3 +++ test/fixtures/full_config.yml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 56e98601..fe3aaaf0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rubocop-shopify (2.12.0) - rubocop (~> 1.45) + rubocop (~> 1.47) GEM remote: https://rubygems.org/ diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index 46a57b0d..dab1a814 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -23,5 +23,5 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.7.0" - s.add_dependency("rubocop", "~> 1.45") + s.add_dependency("rubocop", "~> 1.47") end diff --git a/rubocop.yml b/rubocop.yml index 9cd9a386..c0825316 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -326,6 +326,9 @@ Metrics/BlockLength: Metrics/ClassLength: Enabled: false +Metrics/CollectionLiteralLength: + Enabled: true + Metrics/CyclomaticComplexity: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index fa52cc10..718c6522 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1895,7 +1895,7 @@ Metrics/ClassLength: CountAsOne: [] Metrics/CollectionLiteralLength: Description: Checks for `Array` or `Hash` literals with many entries. - Enabled: pending + Enabled: true VersionAdded: '1.47' LengthThreshold: 250 Metrics/CyclomaticComplexity: From eb0f70ec7137e09805fd37968f93d5b82a57212d Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Tue, 7 Mar 2023 13:43:19 -0500 Subject: [PATCH 4/4] Enable `Style/{Dir,File}Empty` --- Gemfile.lock | 2 +- rubocop-shopify.gemspec | 2 +- rubocop.yml | 6 ++++++ test/fixtures/full_config.yml | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fe3aaaf0..56d4bf51 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rubocop-shopify (2.12.0) - rubocop (~> 1.47) + rubocop (~> 1.48) GEM remote: https://rubygems.org/ diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index dab1a814..2395fccf 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -23,5 +23,5 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.7.0" - s.add_dependency("rubocop", "~> 1.47") + s.add_dependency("rubocop", "~> 1.48") end diff --git a/rubocop.yml b/rubocop.yml index c0825316..a1c685ff 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -466,6 +466,9 @@ Style/DateTime: Style/Dir: Enabled: false +Style/DirEmpty: + Enabled: true + Style/DocumentDynamicEvalDefinition: Enabled: false @@ -511,6 +514,9 @@ Style/ExponentialNotation: Style/FetchEnvVar: Enabled: false +Style/FileEmpty: + Enabled: true + Style/FileRead: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 718c6522..f7762906 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2608,7 +2608,7 @@ Style/Dir: Style/DirEmpty: Description: Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty. - Enabled: pending + Enabled: true VersionAdded: '1.48' Style/DisableCopsWithinSourceCodeDirective: Description: Forbids disabling/enabling cops within source code. @@ -2776,7 +2776,7 @@ Style/FetchEnvVar: Style/FileEmpty: Description: Prefer to use `File.empty?('path/to/file')` when checking if a file is empty. - Enabled: pending + Enabled: true Safe: false SafeAutoCorrect: false VersionAdded: '1.48'