Skip to content
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

Add --no-config-search option to cli #4836

Open
Jason3S opened this issue Sep 18, 2023 · 0 comments
Open

Add --no-config-search option to cli #4836

Jason3S opened this issue Sep 18, 2023 · 0 comments

Comments

@Jason3S
Copy link
Collaborator

Jason3S commented Sep 18, 2023

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 #4750 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant