diff options
author | Joris Roovers <jroovers@cisco.com> | 2015-11-05 12:44:34 +0100 |
---|---|---|
committer | Joris Roovers <jroovers@cisco.com> | 2015-11-05 12:44:34 +0100 |
commit | 18fab5028e2a7538f080a1eb13c853a75989e510 (patch) | |
tree | 8c9bd8edc75aac68d16e05cc2b5ee3d7e3fbd281 /README.md | |
parent | 74328067c671ca3b1991be1e87f7e79149f95e09 (diff) |
Exit codes now range from 0 to 255
This is in line with the supported range of bash exit codes:
http://tldp.org/LDP/abs/html/exitcodes.html
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -12,8 +12,8 @@ Git commit message linter written in python, checks your commit messages for sty Great for use as a ```commit-msg``` git hook or as part of your gating script in a CI/CD pipeline (e.g. jenkins). Many of the gitlint validations are based on -[well-known](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) -[community](http://addamhardy.com/blog/2013/06/05/good-commit-messages-and-enforcing-them-with-git-hooks/) +[well-known](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), +[community](http://addamhardy.com/blog/2013/06/05/good-commit-messages-and-enforcing-them-with-git-hooks/), [standards](http://chris.beams.io/posts/git-commit/), others are based on checks that we've found useful throughout the years. Gitlint has sane defaults, but you can also easily customize it to your own liking. @@ -50,8 +50,7 @@ $ cat examples/commit-message-2 | gitlint 3: B2 Line has trailing whitespace: "Lines typically need to have a max length, meaning that they can't exceed a preset number of characters, usually 80 or 120. " 3: B3 Line contains hard tab characters (\t): "Lines typically need to have a max length, meaning that they can't exceed a preset number of characters, usually 80 or 120. " ``` -NOTE: The returned exit code equals the number of errors found. The exit code ```10000``` is used when gitlint hits a -configuration error. +NOTE: The returned exit code equals the number of errors found. [Some exit codes are special](README.md#exit-codes). You can modify verbosity using the ```-v``` flag, like so: ```bash @@ -211,6 +210,22 @@ Important: Gitlint cannot work together with an existing hook. If you already ha file in your local repository, gitlint will refuse to install the ```commit-msg``` hook. gitlint will also only uninstall unmodified commit-msg hooks that were installed by gitlint. +## Exit codes ## +Gitlint uses the exit code as a simple way to indicate the number of violations found. +Some exit codes are used to indicate special errors as indicated in the table below. + +Because of these special error codes and the fact that +[bash only supports exit codes between 0 and 255](http://tldp.org/LDP/abs/html/exitcodes.html), the maximum number +of violations counted by the exit code is 252. Note that gitlint does not have a limit on the number of violations +it can detect, it will just always return with exit code 252 when the number of violations is greater than or equal +to 252. + +Exit Code | Description +-----------|------------------------------------------------------------ +253 | Wrong invocation of the ```gitlint``` command. +254 | Something went wrong when invoking git. +255 | Invalid gitlint configuration + ## Contributing ## We'd love for you to contribute to gitlint. Just open a pull request and we'll get right on it! |