Skip to content

Cache ignores Rubocop version and rubocop.yml configuration. #299

@joshuapinter

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:

  1. New 👮s are introduced in an upgraded version of the rubocop gem.
  2. 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:

  1. Store the version of the rubocop gem in the cache. If this is different, clear the cache before running.
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions