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
How to make --parallel and --cache false work together? #9744
Comments
Unfortunately this is going to take a large rewrite of how some of the internals of RuboCop work. The current strategy for parallel relies on caching because it splits the files that will be scanned by RuboCop into different groups, invokes RuboCop X number times on the subset groups of files with caching enabled, then once each "sub job" is finished, it reruns RuboCop over the entire project. This last run picks up the cache from the parallel run allowing it run quickly. The whole process is still faster than running RuboCop without cache or parallel. It's been a while since I looked into this. I think there's been some work to help improve the situation so that we might be able to use a real parallel at some point. I think there have been challenges around the internal design and being able to split work based on cop or file. I'm curious why |
I found AtomLinter/linter-rubocop@7579065, maybe @vzamanillo can share more details? I'd also be fine with having parallel automatically deactivated, don't know why in rubocop/lib/rubocop/options.rb Lines 340 to 346 in 74377b0
|
I wasn't even thinking about disabling parallel when cache is disabled until later last night. |
I'm using the linter-rubocop package in Atom, that sets
--cache false
for calls to rubocop. Since activation of--parallel
via.rubocop
file in my project, I get the error-P/--parallel uses caching to speed up execution, so combining with --cache false is not allowed.
Expected behavior
I see two options:
--parallel
if--cache false
is set, similar torubocop/lib/rubocop/options.rb
Lines 349 to 354 in 74377b0
--no-parallel
CLI option to override the--parallel
from.rubocop
file.Eventually
bundle exec rubocop --cache false [--no-parallel]
should run rubocop and not output-P/--parallel uses caching to speed up execution, so combining with --cache false is not allowed.
Actual behavior
Rubocop prints
-P/--parallel uses caching to speed up execution, so combining with --cache false is not allowed.
Steps to reproduce the problem
Add
--parallel
to.rubocop
file and runbundle exec rubocop --cache false [--no-parallel]
RuboCop version
The text was updated successfully, but these errors were encountered: