-
Notifications
You must be signed in to change notification settings - Fork 653
[heft-lint-plugin] Stabilize linter cache filename using tsconfig path hash #5437
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: dmichon-msft <[email protected]>
dmichon-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get the config file path from the program's getCompilerOptions().configFilePath (may require null checking). This will greatly simplify the code change.
|
@copilot address feedback |
…se64url encoding, and sort files Co-authored-by: dmichon-msft <[email protected]>
Done in commit ba0baea. The implementation now uses program.getCompilerOptions().configFilePath as suggested, which greatly simplified the code. |
|
@copilot Run |
Co-authored-by: dmichon-msft <[email protected]>
Summary
The linter cache filename used a hash of all input filenames, causing cache churn when files were added/removed. This stabilizes the cache filename by hashing the tsconfig path instead, while moving the files hash into the cache data for validation.
Fixes #5436
Details
Cache filename generation (
LinterBase.ts):program.getCompilerOptions().configFilePathILinterCacheData.filesHashfield for cache validationbase64urlencoding for hashes (filesHash without truncation, hashSuffix truncated to 8 chars for filename)cacheVersionorfilesHashchangesSimplified implementation (
LintPlugin.ts):Before:
After:
How it was tested
Impacted documentation
None - this is an internal implementation change that does not affect the public API or user-facing behavior.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.