mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 23:23:37 +01:00
pkl format should not exit with 11 in case of violation found
#365
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @StefMa on GitHub (Nov 18, 2025).
I'm not an CLI nor an exit code expert.
But when I run
pkl format -w .I realize that it exit with 11 (violation found).This is also documented:
However, I think a CLI should only return non zero in case of an error in the process.
It should not return non zero in case the CLI (format) tool runs successfully, but found problems.
Looking also into wikipedia about Exit status:
For me it sounds like "a non exit code means the program doesn't behave correctly, failed for some reaasons".
But it is not! It just found violation errors. This is his job 🤷 😁
What do you think?
@thejcannon commented on GitHub (Dec 3, 2025):
Looking at other file formatters:
ruff format(
ruff format --checkandruff format)gofmt(
gofmt -dandgofmt -w)shfmt(
shfmt -dandshfmt -w)rustfmt(
rustfmt --checkandrustfmt)yamlfmt(
yamlfmt -lintandyamlfmt)taplo format(
taplo format --checkandtaplo format)pkl format(
pkl format --diff-name-onlyandpkl format -w)@bioball commented on GitHub (Dec 3, 2025):
@thejcannon thanks for the comparison! I'm convinced that we should just change this.
@thejcannon commented on GitHub (Dec 6, 2025):
Thanks for the quick update. ♥️