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

fix: fix #1807 #1837

Merged
merged 2 commits into from
Oct 6, 2021
Merged

fix: fix #1807 #1837

merged 2 commits into from
Oct 6, 2021

Conversation

Jason3S
Copy link
Collaborator

@Jason3S Jason3S commented Oct 5, 2021

Make sure files are counted, even if they are cached.

Make sure files are counted, even if they are cached.
@github-actions github-actions bot added the fix label Oct 5, 2021
@@ -44,12 +44,14 @@ export class DiskCache implements CSpellLintResultCache {

// Skip reading empty files and files without lint error
const hasErrors = meta.result.errors > 0 || meta.result.configErrors > 0 || meta.result.issues.length > 0;
const shouldReadFile = meta.size !== 0 && hasErrors;
const cached = !!meta.size;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be called nonEmpty for readbility?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is communicating to the cache consumer that the entry was cached. How that calculation is done is up to the cache itself. It is possible that cached = true might be the correct thing and restore the original shouldReadFile calculation. It is still not clear to me under which situations meta.size will be 0.

@Jason3S Jason3S merged commit 9608b77 into main Oct 6, 2021
@Jason3S Jason3S deleted the dev-cache branch October 6, 2021 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants