cspell
cspell copied to clipboard
Add `--no-config-search` option to cli
The original idea, was the local config has more knowledge of the files being checked than a global config.
This allows for things like specifying the language.
For example:
cspell.config.yaml - language: en
i18n/de/cspell.config.yaml - language: de
i18n/de/README.md
At the root:
cspell "**/*.md", would use German when spellcheckingi18n/de/README.md.
But by automatically turning on noConfigSearch, the following would break:
cspell --config cspell.config.yaml "**/*.md"would use English instead of German.
Even though both invocations of cspell use cspell.config.yaml, the behavior would be different.
I propose added two new options: --no-config-search and --config-root.
--no-config-searchwould just enabled adding the behavior to the command line.--stop-config-search-at <dir>would tell the spellchecker to not look further up the hierarchy than the specified<dir>. It also makes sense that more than one stop could be wanted.
Originally posted by @Jason3S in https://github.com/streetsidesoftware/cspell/issues/4750#issuecomment-1719056548
@thebolarin
This is a good issue too.