betterer
betterer copied to clipboard
Caching prevents re-checking a file that has new changes
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