You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issues from a universal cache are reported at the path of the machine that made the cache #9427
A cache made with cacheFormat: universal stores file paths relative to the cache, so it can be reused after the project moves, for example to another machine or another checkout folder. But the spelling issues it stores keep the absolute file URL. After a move, cached issues are reported at the old location.
Steps to reproduce
In folder a, create doc.md containing This has a speling mistake. and a cspell.json:
Copy folder a, including .cspellcache, to folder b.
Run cspell doc.md in b.
Expected
doc.md:1:12 - Unknown word (speling) fix: (spelling)
CSpell: Files checked: 1 (1 from cache), Issues found: 1 in 1 file.
Actual
/…/a/doc.md:1:12 - Unknown word (speling) fix: (spelling)
CSpell: Files checked: 1 (1 from cache), Issues found: 1 in 1 file.
The result comes from the cache, but the issue points at folder a, which may not exist on this machine. Running with --no-cache in b reports doc.md.
Seen in every version tested, from 6.31.3 to 10.3.6.
Missing test
The cache tests use a sample project with no spelling issues, and only count how many files were checked and how many came from the cache. A cached result only carries a file path when the file has an issue, so the tests never stored one. That's likely why this went unnoticed.
A test with a misspelled word that lints a project, copies it with its cache to another folder, and expects the cached issues to match a --no-cache run would catch it.
Activity