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
Define how separately declared include and exclude globs combine #9463
Since #9408, the patterns in a single glob list are applied in order and the last matching pattern wins, as in .gitignore. That covers one .gitignore file, one ignorePaths list, and one overrides[].filename list.
Include and exclude globs are often declared in separate places, so they have no order between them:
The files and ignorePaths settings in a config file.
Globs on the command line and --exclude.
Command-line globs that start with !, which cspell moves into the exclude list.
.gitignore files when useGitignore is on, on top of ignorePaths.
ignorePaths from several config files that are merged through import. They are combined in a depth-first walk of the imports.
Today an exclude always wins over an include in these cases, so a file can't be brought back once any exclude matches it. For example, ignorePaths: ["!docs/keep.md"] can't re-include a file that a .gitignore excludes. The cspell command line skips ignorePaths patterns that start with ! and shows a warning.
Questions to answer
Should an exclude always win over an include when they come from different places, or should there be a defined order between the sources?
If there is an order, what is it? For example: .gitignore, then config ignorePaths in depth-first import order, then the command line.
Should ignorePaths patterns that start with ! work on the command line, and what do they re-include?
Activity