Expected Behavior
Exit with a code that's greater than 0, and different from 1, 2, and 3 when the configuration from the CLI is incomplete (such as when missing --extends), or when there's no configuration file.
Current Behavior
Commitlint exits with an exit code equal to 1 when there are configuration errors or when there are linting errors. This makes it impossible to differentiate between linting issues and commitlint configuration issues.
Affected packages
Possible Solution
I don't know much about commitlint implementation to suggest a possible design. :(
I'm suggesting something different from:
1 (commit linting errors)
2 and 3 (commit linting errors and warnings in strict mode)
Context
Steps to reproduce the behavior:
-
mkdir /tmp/test-commitlint
-
cd /tmp/test-commitlint
-
git init
-
touch test.txt
-
git add test.txt
-
git commit -m "Initial commit"
-
commitlint --last
Output (expected):
⧗ input: Initial commit
✖ Please add rules to your `commitlint.config.js`
- Getting started guide: https://commitlint.js.org/guides/getting-started
- Example config: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/src/index.ts [empty-rules]
✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
-
echo $?
-
commitlint --version
Output:
Thanks!
Expected Behavior
Exit with a code that's greater than
0, and different from1,2, and3when the configuration from the CLI is incomplete (such as when missing--extends), or when there's no configuration file.Current Behavior
Commitlint exits with an exit code equal to
1when there are configuration errors or when there are linting errors. This makes it impossible to differentiate between linting issues and commitlint configuration issues.Affected packages
Possible Solution
I don't know much about commitlint implementation to suggest a possible design. :(
I'm suggesting something different from:
1(commit linting errors)2and3(commit linting errors and warnings in strict mode)Context
Steps to reproduce the behavior:
mkdir /tmp/test-commitlintcd /tmp/test-commitlintgit inittouch test.txtgit add test.txtgit commit -m "Initial commit"commitlint --lastOutput (expected):
echo $?commitlint --versionOutput:
Thanks!