You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def xxx
# rubocop:disable Performance/InefficientHashSearch
# `rule` is a `Dry::Validation::Rule`, not a `Hash`
return true if rule.keys.include?(@key_chain)
# rubocop:enable Performance/InefficientHashSearch
false
end
Actual behavior
$ rubocop --debug /tmp/tst.rb
For /tmp: configuration from /tmp/.rubocop.yml
configuration from /home/ojab/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rubocop-performance-1.10.1/config/default.yml
configuration from /home/ojab/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rubocop-performance-1.10.1/config/default.yml
Default configuration from /home/ojab/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rubocop-1.11.0/config/default.yml
Inspecting 1 file
Scanning /tmp/tst.rb
C
Offenses:
tst.rb:4:3: C: [Correctable] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return true if rule.keys.include?(@key_chain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 1 offense detected, 1 offense auto-correctable
…rdClause`
Fixesrubocop#9608.
This PR fixes a false positive for `Layout/EmptyLineAfterGuardClause`
when using guard clause is after `rubocop:enable` comment.
Expected behavior
#9146, but I can reproduce it with rubocop-1.11.0 with config:
and code:
Actual behavior
Steps to reproduce the problem
Run the code above with config above.
RuboCop version
The text was updated successfully, but these errors were encountered: