v8.5.0
Changes
Features
feat: Add `--file [files...]` command line option to lint command. (#5328)
feat: Add --file [files...]
command line option to lint command. (#5328)
fixes: #5225
Options:
--file
and--files
- specify files to be checked
--file [files...]
, alias --files
.
The --file
option enables specifying which files to check. This is useful when the list is generated by another process and --file-list
is not a good fit.
The files will be filtered by [globs...]
or cspellConfig.files
if the [globs...]
were not specified.
Usage:
cspell.config.yaml
files:
- '**/*.md'
ignorePaths:
- 'CHANGELOG.md'
Command:
cspell --files README.md CHANGELOG.md LICENSE
Result:
It will only check README.md
because LICENSE
does not match *.md
and CHANGELOG.md
is excluded by ignorePaths
.
Command Line Only
The same effect can be achieved on the command line:
cspell "*.md" --exclude CHANGELOG.md --files README.md CHANGELOG.md LICENSE
- or -
cspell --exclude CHANGELOG.md --files README.md CHANGELOG.md LICENSE -- "*.md"