Cache ignores Rubocop version and rubocop.yml
configuration. #299
Description
We ran into this when we upgraded the version of rubocop
gem and our local ERB Linting (using --cache
) did not find any issues but our CI Linting (not using --cache
) found 56 errors.
When we disabled --cache
in our local environment, the same 56 errors appeared. If we also used --clear-cache
and then re-enabled --cache
, we found the same 56 errors as well.
Thinking about it, this happens because of two reasons:
- New 👮s are introduced in an upgraded version of the
rubocop
gem. - You change your
.rubocop.yml
or.erb-lint.yml
configuration to enable or change existing 👮s.
So I'm thinking this could be solved with two main changes:
- Store the version of the
rubocop
gem in the cache. If this is different, clear the cache before running. - Store the hash or something of both the
.rubocop.yml
and.erb-lint.yml
files. If either of these are different, clear the cache before running.
Related to #268 so I would love @zachfeldman's input since he masterminded this great caching feature.
Let me know your thoughts and I'm happy to take a look myself.
Thanks for the great work!
Metadata
Assignees
Labels
No labels