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
Style/OptionalBooleanParameter offenses are listed as auto-correctable #8755
Comments
Odd. See also #8757 ? |
@jafuentest what's in your $ bundle exec rubocop test.rb -A
Inspecting 1 file
C
Offenses:
test.rb:3:18: C: Style/OptionalBooleanParameter: Use keyword arguments when defining method with boolean argument.
def do_something(bad = true)
^^^^^^^^^^
1 file inspected, 1 offense detected |
Sorry, I forgot about it, here's my config:
|
@jafuentest I tried again using your config and still cannot replicate what you're seeing. Maybe can you make a repo with a minimum replication case? |
@jafuentest Does running |
Ok so here's what I found. I tried again and couldn't replicate the error, but also noticed I had an older version (I guess I discarded the changes to Gemfile.lock because of this). So went and updated again to 0.91, and then it started happening again
Tried with |
👍 This issue, due to cache, happens on the 2nd and further run. It applies to any I'm not sure what does cache invalidation and such, but 2 consecutive runs with nothing else for sure uses it.. Also noted this as a feature to let us know about cache usage #8842, feel free to support that as well. |
This is a copy paste version for testing the patch
Use rubocop as before
To return later to mainstream rubocop
|
This issue will be closed due to #8841 has been merged. |
Here's the output I got running rubocop after updatingg
Expected behavior
n offenses auto-correctable
should display the correct amount of offenses that can be fixed withrubocop -a
Actual behavior
It's listing all offenses as auto-correctable
Steps to reproduce the problem
I'm not sure, I think it's specific to the
Style/OptionalBooleanParameter
cop, so it should be enough to define a method likedef do_something(bad = true)
RuboCop version
0.91.0 (using Parser 2.7.1.4, rubocop-ast 0.4.2, running on ruby 2.6.6 x86_64-linux)
The text was updated successfully, but these errors were encountered: