-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
fix: Add --no-exit-code
option to prevent spelling issues from impacting the exit code.
#4809
Conversation
Thank you. I'm open to the idea. I have to think about the name. Things to consider: There is a difference between issues and errors.
Only
This new option should only impact issues and not errors. Errors can be handled using the Ideas:
A future option: |
853944a
to
1934727
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to #4809 (comment)
How about --no-exit-code
- Spelling issues will not set the exit code.
? Implies --no-must-find-files
.
@@ -170,7 +171,8 @@ export function commandLint(prog: Command): Command { | |||
throw new CheckFailed('outputHelp', 1); | |||
} | |||
if (result.issues || result.errors || (mustFindFiles && !result.files)) { | |||
throw new CheckFailed('check failed', 1); | |||
const exitCode = options.allowFailure ? 0 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result.errors
is a real error.
Logic:
const exitCode = options.allowFailure ? 0 : 1; | |
const exitCode = result.errors || !options.allowFailure ? 1 : 0; |
It will be necessary to update the snapshots. In pnpm vitest run -u |
I'm open to either Also, I was trying to build using
Any ideas? |
Let's go with As far as the build, I think you might need to clean first: |
How does this look? @Jason3S |
The `--no-exit-code` option becomes `exitCode`.
The command line parser turns I corrects the Options interface and updated the snapshots. |
--no-exit-code
option to prevent spelling issues from impacting the exit code.
This PR implements a simple
--allow-failure
flag, which configurescspell
to return 0 exit code even when there are findings. This is useful for uses in CI (such as in a pre-commit hook) to allow reporting findings without failing the pre-commit.