Skip to content
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

Caching prevents re-checking a file that has new changes #1172

Open
tarngerine opened this issue Aug 23, 2023 · 0 comments
Open

Caching prevents re-checking a file that has new changes #1172

tarngerine opened this issue Aug 23, 2023 · 0 comments

Comments

@tarngerine
Copy link

Describe the bug
I'm testing betterer for our codebase (a single eslint rule, which you can see here #1171 ), and I'm trying the --cache option because adding 10+ seconds to our precommit time isn't acceptable. However, I'm finding that cache is overly aggressive and doesn't recheck a file that is has newly staged changes

To Reproduce

  • add a eslint rule to the betterer config
  • add betterer precommit --cache to lint-staged
  • add 1 line with a rule that violates to some File.ts
  • git add that file to stage it
  • run lint-staged
  • it correctly flags an error
  • add a second line with a new rule violation
  • git add that file again
  • run lint-staged
  • it does not flag an error

Expected behavior

It should re-run betterer on this file that has newly staged changes. I'm not sure what those hashes are in .betterer.cache but i'm not seeing those change.

Versions (please complete the following information):

  • OS: MacOS Ventura
  • Betterer Version 4.5
  • Node Version 18.17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant