-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Feature: add support for RUBOCOP_CACHE_ROOT env variable to control cache path #8639
Feature: add support for RUBOCOP_CACHE_ROOT env variable to control cache path #8639
Conversation
I'm fined with the proposed change, although the rationale for it in the docs should be expanded upon. I also like the idea a having a cli option for this, which IMO should have the highest possible priority (and also introduces less cognitive overhead). |
On another note, do you think it would be beneficial to print a warning, if either |
To stay consistent with the way the documentation mentions the variable
Might be useful, but I don't think that will add that much value, as in some cases the users would have done this intentionally and the warning would just be annoying to them (e.g. different setup for local development and CI with the same config file). |
Thanks! |
This PR introduces the
--cache-root
command line option and support for theRUBOCOP_CACHE_ROOT
env variable to control the cache root directory.It takes precedence over everything else (even the config file) which makes it perfectly suited for CI usage where it's very helpful to control the cache path (without interference from the config file) to consistently be able to save and restore rubocop's cache files.
Possible further steps
--cache-root
RUBOCOP_CACHE_ROOT
andCacheRootDirectory
in the config fileTODO
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.