cspell icon indicating copy to clipboard operation
cspell copied to clipboard

Add `--no-config-search` option to cli

Open Jason3S opened this issue 2 years ago • 1 comments

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 spellchecking i18n/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-search would 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

Jason3S avatar Sep 18 '23 05:09 Jason3S

@thebolarin

This is a good issue too.

Jason3S avatar Apr 23 '25 11:04 Jason3S