Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rubocop from 1.45.1 to 1.48.0 #510

Merged
merged 4 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
rubocop-shopify (2.12.0)
rubocop (~> 1.45)
rubocop (~> 1.48)

GEM
remote: https://rubygems.org/
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rubocop-shopify.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.48")
end
9 changes: 9 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ Metrics/BlockLength:
Metrics/ClassLength:
Enabled: false

Metrics/CollectionLiteralLength:
Enabled: true
Comment on lines +329 to +330
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubocop/rubocop#11584 (comment) summarizes why I created this cop and why I'd like to enable it. TL;DR: every time I've seen huge literals, there was a better approach.


Metrics/CyclomaticComplexity:
Enabled: false

Expand Down Expand Up @@ -463,6 +466,9 @@ Style/DateTime:
Style/Dir:
Enabled: false

Style/DirEmpty:
Enabled: true
Comment on lines +469 to +470
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem simple enough, so I went ahead and enabled them.


Style/DocumentDynamicEvalDefinition:
Enabled: false

Expand Down Expand Up @@ -508,6 +514,9 @@ Style/ExponentialNotation:
Style/FetchEnvVar:
Enabled: false

Style/FileEmpty:
Enabled: true

Style/FileRead:
Enabled: false

Expand Down
29 changes: 24 additions & 5 deletions test/fixtures/full_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ AllCops:
- rake
rubocop-graphql:
- graphql
rubocop-capybara:
- capybara
ActiveSupportExtensionsEnabled: false
Bundler/DuplicatedGem:
Description: Checks for duplicate gem entries in Gemfile.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1895,6 +1893,11 @@ Metrics/ClassLength:
CountComments: false
Max: 100
CountAsOne: []
Metrics/CollectionLiteralLength:
Description: Checks for `Array` or `Hash` literals with many entries.
Enabled: true
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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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#*.
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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: true
VersionAdded: '1.48'
Style/DisableCopsWithinSourceCodeDirective:
Description: Forbids disabling/enabling cops within source code.
Enabled: false
Expand Down Expand Up @@ -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: true
Safe: false
SafeAutoCorrect: false
VersionAdded: '1.48'
Style/FileRead:
Description: Favor `File.(bin)read` convenience methods.
StyleGuide: "#file-read"
Expand Down