Description
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
- cli
- core
- prompt
- config-angular
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
and3
(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 $?
1
-
commitlint --version
Output:
@commitlint/[email protected]
Thanks!