Fixes
fix(cspell-lib): `shouldCheckDocument` honors the `forceCheck` option (#9303)
fix(cspell-lib): shouldCheckDocument honors the forceCheck option (#9303)
Summary
For users of the cspell-lib API:
shouldCheckDocumentnow honorsforceCheck. It returnsshouldCheck: truefor a document excluded byignorePaths, or disabled byoverridesorlanguageSettings. Before, the option was accepted but ignored.DocumentValidatoralready worked this way.SpellCheckFileOptionsnow declaresforceCheck, so it can be passed tospellCheckDocumentandspellCheckFilewith type checking.
fix: `--force-check` checks the listed files even when `ignorePaths` or `files` would skip them (#9300)
fix: --force-check checks the listed files even when ignorePaths or files would skip them (#9300)
Summary
--force-check now checks every file given with --file or --file-list, as its help says. Before, some of those files were still skipped:
- files matched by
ignorePathsin the config; - files that don't match the
filessetting in the config.
Using globs on the command line together with --force-check is now an error, the same as globs with --file:
error: mixing globs and --force-check is not supported
Before, cspell lint --file-list list.txt "**/*.md" --force-check was accepted. To filter a file list by glob, leave out --force-check.
fix: `files` globs starting with `**` no longer skip `--file` and `--file-list` files in a project under a dot folder (#9299)
fix: files globs starting with ** no longer skip --file and --file-list files in a project under a dot folder (#9299)
Summary
When a project was under a folder whose name starts with a dot, such as ~/.local/src/my-project or a git worktree in .claude/worktrees/, files given with --file or --file-list could be skipped without any warning. CSpell then reported Files checked: 0 and exited with success.
This happened when the listed files were filtered by a glob starting with **:
- from the
filessetting in the config, for--fileand--file-list; - from globs on the command line, for
--file-list, for examplecspell lint --file-list changed-files.txt "**/*.md".
These files are now checked.
- Files and folders inside the project whose names start with a dot are still left out unless
--dotorenableGlobDotis set, as before. - Checking with globs alone (
cspell lint "**/*.md") was not affected.
fix: Thai text and substitutions are checked and reported correctly (#9289)
fix: Thai text and substitutions are checked and reported correctly (#9289)
Fixes problems with checking text that cspell changes before spell checking, such as Thai text split into words with useIntlWordSegmentation, or text changed by substitutions (for example HTML entities or escaped quotes).
- Thai text no longer stops the check with an error. Checking Thai text, or any text with
useIntlWordSegmentationturned on, could stop with an internal error (AssertionError [ERR_ASSERTION]) on certain words. In cspell 10.3.3 and earlier, the file was reported as skipped and not checked. Starting with 10.3.4, the whole run failed. These files are now checked normally. The problem was found with the Thai wordกระดูกสฟีนอยด์. - Issues are reported at the right place. When text was changed more than once before checking, for example by two sets of substitutions, issues after the first change could be reported at the wrong position in the file. They are now reported where the word actually is.
- Substitutions without definitions are applied. Substitutions given directly as
[find, replacement]pairs were ignored unlesssubstitutionDefinitionswas also set. They are now always applied.
Fixes #9281