-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
💡: Ignore files not specified in files but passed to the argument. #5225
Comments
Thank you for the feedback and suggestion. The The git diff --name-only | cspell --no-must-find-files --file-list stdin To only check git diff --name-only | cspell --no-must-find-files --file-list stdin "**/*.md" This has come up before, so maybe it needs to be changed. In the original logic, the glob on the command-line was the "include" glob and It would be a breaking change, but maybe it would avoid confusion:
|
Thanks for reply. Not sure if I understood you correctly, but I think "always filter on The other solution (inverted logic) would be adding a new option like we needed for git only DL;TR: Always filter on |
It should work on Windows. I'll double check. Can you give an example where it does not work? or show how you are using it?
|
I have tried using the PowerShell
Command Prompt
|
I you happened to type in just |
I went with a different approach. I added a new option In your case it would be:
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Problem
I use
cspell.json
to definefiles
to be checked. For example the pathsrc/**/*
. This works great with the VSCode extension. But if I use the cspell cli to check a specific file, it ignores this include arrayfiles
. It makes sense when scanning an individual file. But if Git hook (husky, lint-staged) is used for pre-commit, the individual files are also checked. Which also ignores the cspell.jsonfiles
array.Example:
root (snippet)
|- cspell.json
|- other.md
|- src/main.ts
cspell.json (snippet)
src/**/*
only. Not on root likeother.md
. (Correct/Expected)files
. (Correct/Expected)files
from cspell.json. I understand why. I think it's also correct. But maybe not what you expect. Especially when this is used in Git hook.Solution
I think we need a new option to respect the
files
array from cspell.json even when passing a file path to the arguments to scan.I don't know how to name the new option. At this moment I call it
strict
. If the file you passed to check is not in thefiles
array, it will ignore typos. Maybe only show a info, that the file is ignored by the configuration.Alternatives
Currently I need to use
ignorePaths
for each individual file or path. Additional to thefiles
array which is expected as the inverted logic "included files" (files), "excluded files" (ignorePaths). Or is it possible to ignore all (ignorePath
) exceptfiles
? But I would expect anything not specified infiles
to be ignored.Additional Context
I would be great to setup all included and excluded files once. Which has also effect when checking individual files manually (Git hook). Maybe an option? Or does this already exist? Or is this finally a bug?
Code of Conduct
The text was updated successfully, but these errors were encountered: