Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Invalidate cache if linter path or arguments change (#19) #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siebert
Copy link
Contributor

@siebert siebert commented Aug 29, 2018

The cache is not invalidated if the arguments (or path) of the linter program changes. To fix this I change the path where the cached data is stored. A sha256 hex hash value is appended of the linter name, which is created by hashing the linter program name and arguments.

Copy link
Owner

@sk- sk- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @siebert for the PR. I added some comments, and you would still need to fix the e2e tests.

However the bigger question is regarding outdated cache files. As now without a readable name for the cache it's almost impossible to know which folders you could remove.

I think that an idea that incorporates your hash idea is to have a placeholder along the cache directory, something like:

cache
 - python.hash
 - python
    - file1
    - file2
 - ruby.hash
 - ruby
    - file4
    - file5

In that way whenever the hash changes you could remove the cache folder.

@siebert siebert force-pushed the master-cachefix branch 3 times, most recently from 3b6185e to 689ab78 Compare October 18, 2018 16:10
@siebert
Copy link
Contributor Author

siebert commented Oct 18, 2018

@sk- Can you review the current patch again?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants