Skip to content

Add format-ignore-exit-code configuration#285

Merged
mattn merged 4 commits intomattn:masterfrom
sirreal:add-formatter-ignore-exit-code
Feb 1, 2026
Merged

Add format-ignore-exit-code configuration#285
mattn merged 4 commits intomattn:masterfrom
sirreal:add-formatter-ignore-exit-code

Conversation

@sirreal
Copy link
Copy Markdown
Contributor

@sirreal sirreal commented Nov 5, 2024

Add a new configuration option to ignore formatter exit codes.

Some formatters use non-zero exit codes when formatting was successful. See #183.

For example, phpcbf uses a non-zero exit code that cannot be configured at this time: squizlabs/PHP_CodeSniffer#2898

Fixes #183.

#271 can likely also be closed with if this change lands.

LintOnSave bool `yaml:"lint-on-save" json:"lintOnSave"`
FormatCommand string `yaml:"format-command" json:"formatCommand"`
FormatCanRange bool `yaml:"format-can-range" json:"formatCanRange"`
FormatIgnoreExitCode bool `yaml:"format-ignore-exit-code" json:"formatIgnoreExitCode"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a big whitespace diff here, but only this line was changed.

@mattn
Copy link
Copy Markdown
Owner

mattn commented Jan 31, 2026

Thank you. Could you please fix conflict?

@sirreal
Copy link
Copy Markdown
Contributor Author

sirreal commented Feb 1, 2026

@mattn I've merged master with the schema freshly regenerated. This is now conflict free.

@sirreal
Copy link
Copy Markdown
Contributor Author

sirreal commented Feb 1, 2026

It's tricky to generate the schema with the correct versions.

For posterity, this is what I did:

docker run -it -v "$(pwd):/app" -w /app python:3.12-alpine sh -c "apk add --no-cache bash make && pip install json-schema-for-humans==0.45.2 && make schema_doc"

@mattn mattn merged commit 91ff5c0 into mattn:master Feb 1, 2026
3 checks passed
@mattn
Copy link
Copy Markdown
Owner

mattn commented Feb 1, 2026

Thank you

@sirreal sirreal deleted the add-formatter-ignore-exit-code branch February 1, 2026 11:23
@sirreal
Copy link
Copy Markdown
Contributor Author

sirreal commented Feb 1, 2026

Thank you!

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

Successfully merging this pull request may close these issues.

Ability to ignore the format command exit code

2 participants