Skip to content

fix: Report a missing --config file in check and dictionaries - #9764

Open
Kernel-Hunter wants to merge 1 commit into
streetsidesoftware:mainfrom
Kernel-Hunter:fix-check-dictionaries-missing-config
Open

Kernel-Hunter wants to merge 1 commit into
streetsidesoftware:mainfrom
Kernel-Hunter:fix-check-dictionaries-missing-config

Conversation

@Kernel-Hunter

Copy link
Copy Markdown

Fixes #9763.

cspell check --config missing.json file and cspell dictionaries --config missing.json ignored the missing file, printed nothing and exited 0. Both now print the configuration error and exit 1:

Configuration Error: Failed to read config file: ".../missing.json"

The check is a new assertNoConfigErrors in configFileHelper.ts, which throws a ConfigurationError (an ApplicationError). check lets that error through instead of wrapping it as a per-file failure. I added tests for check, check --json and dictionaries; they fail on main and pass now. The full cspell package suite passes except one remote-cache test that needs network.

trace and suggest also don't report a missing config on current main (exit 0). I left them alone since the issue only names the other two. Happy to do them here if you want.

Both commands carried on without the file, printed no error and exited with 0.
They now print the configuration error and exit with 1, like `lint`.

Fixes streetsidesoftware#9763
@github-actions github-actions Bot added the fix label Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cspell check and cspell dictionaries ignore a config file that can't be read

1 participant