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
Auto disable parallel when combined with --auto-correct, --auto-gen-config, or --fail-fast #9647
Conversation
lib/rubocop/options.rb
Outdated
@@ -362,16 +362,19 @@ def validate_parallel | |||
|
|||
def validate_parallel_with_combo_option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename this method now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thought. I couldn't think of great name for what this is doing. I think this is the first time we're disabling incompatible configs so maybe a new method entry point? Maybe something like fix_invalid_parallel_combos
or disable_invalid_parallel_option
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rrosenblum thanks! I was going to get to this but hadn't gotten a chance yet. This is a great implementation.
One note: maybe your changed tests should expect that there is no parallel key in options after parsing?
@dvandersluis I like that idea, any thoughts on how to implement the check? |
b9e6c5e
to
48faa05
Compare
48faa05
to
0f42d49
Compare
Sorry Ryan, I had intended to give you an answer to your question and totally forgot. We could conceivably add a delegate to |
It's cool. Unless you have strong feeling about it, I'm inclined to use |
0f42d49
to
739c161
Compare
739c161
to
72abc6a
Compare
Thanks! |
This came up in a conversation in #9640. We probably should have made it work this way from the start instead of raising an exception.
It felt a big weird to handle this inside of a "validation". Please let me know if there is a better place for the code or if there is better error message.
I left in the code to delete the parallel flag from the rake task to avoid printing the warning about parallel being ignored.