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

Update Rubocop to v1.68 #659

Merged
merged 4 commits into from
Nov 12, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Updates rubocop to [1.68.0]https://github.com/rubocop/rubocop/tree/v1.68.0)
* Inherit from `RuboCop::Cop::Base` fixing deprecation warnings.
* Add new cops

## 1.41.1

* Adds a stub method to the Ruby LSP add-on to avoid a potential runtime exception
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
standard (1.41.1)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.66.0)
rubocop (~> 1.68.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.5)

Expand Down Expand Up @@ -34,7 +34,7 @@ GEM
rbs (3.5.2)
logger
regexp_parser (2.8.2)
rubocop (1.66.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
21 changes: 21 additions & 0 deletions config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ Lint/DuplicateRequire:
Lint/DuplicateRescueException:
Enabled: true

Lint/DuplicateSetElement:
Enabled: false

Lint/EachWithObjectArgument:
Enabled: true

Expand Down Expand Up @@ -798,6 +801,9 @@ Lint/TripleQuotes:
Lint/UnderscorePrefixedVariableName:
Enabled: true

Lint/UnescapedBracketInRegexp:
Enabled: false

Lint/UnexpectedBlockArity:
Enabled: false

Expand Down Expand Up @@ -980,6 +986,9 @@ Style/Alias:
Enabled: true
EnforcedStyle: prefer_alias_method

Style/AmbiguousEndlessMethodDefinition:
Enabled: false

Style/AndOr:
Enabled: true

Expand Down Expand Up @@ -1017,6 +1026,9 @@ Style/BeginBlock:
Style/BisectedAttrAccessor:
Enabled: false

Style/BitwisePredicate:
Enabled: false

Style/BlockComments:
Enabled: true

Expand Down Expand Up @@ -1063,6 +1075,9 @@ Style/ColonMethodCall:
Style/ColonMethodDefinition:
Enabled: true

Style/CombinableDefined:
Enabled: false

Style/CombinableLoops:
Enabled: false

Expand Down Expand Up @@ -1290,6 +1305,9 @@ Style/InvertibleUnlessCondition:
Style/IpAddresses:
Enabled: false

Style/KeywordArgumentsMerging:
Enabled: false

Style/KeywordParametersOrder:
Enabled: true

Expand Down Expand Up @@ -1655,6 +1673,9 @@ Style/SafeNavigation:
- try
- try!

Style/SafeNavigationChainLength:
Emabled: false

Style/Sample:
Enabled: true

Expand Down
2 changes: 1 addition & 1 deletion standard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.metadata["rubygems_mfa_required"] = "true"

spec.add_dependency "rubocop", "~> 1.66.0"
spec.add_dependency "rubocop", "~> 1.68.0"

spec.add_dependency "lint_roller", "~> 1.0"
spec.add_dependency "standard-custom", "~> 1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/extend_config/bananas.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RuboCop
module Cop
module Bananas
class BananasOnly < Cop
class BananasOnly < Base
def on_lvasgn(node)
name, = *node

Expand Down
2 changes: 1 addition & 1 deletion test/fixture/extend_config/betterment.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RuboCop
module Cop
module Betterment
class UnscopedFind < Cop
class UnscopedFind < Base
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/plugins/project/lib/banana/banana_bomb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module RuboCop
module Cop
module Bananas
class BananaBomb < Cop
class BananaBomb < Base
def on_class(node)
add_offense(node, message: "🍌💣 - Better ignore me!")
end
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/plugins/project/lib/banana/bananas.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RuboCop
module Cop
module Bananas
class BananasOnly < Cop
class BananasOnly < Base
def on_lvasgn(node)
# cracks me up that we have to disable this cop inside itself
name, = *node # standard:disable Bananas/BananasOnly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ def rules(context)

module RuboCop::Cop
module Fake
class Things < RuboCop::Cop::Cop
class Things < RuboCop::Cop::Base
end

class Stuff < RuboCop::Cop::Cop
class Stuff < RuboCop::Cop::Base
end

class Junk < RuboCop::Cop::Cop
class Junk < RuboCop::Cop::Base
end

class Crap < RuboCop::Cop::Cop
class Crap < RuboCop::Cop::Base
end
end
end
Expand Down