gitlint
gitlint copied to clipboard
Allow to flag rules as error or warning
As gitlint is used in our CI flow, I must keep it globally as warning only for the moment.
I would like to be able to set some rules as error, for example "title-must-not-contain-word". Some other rules may be warning only, "body-is-missing" for example.
First of all, what do you think of such an feature? Do you think it is already possible? I would not like to call gitlint twice with different config files.
For implementation detail, it could look like:
- add an optional
status=[error,warning]rule option, which default toerror, then it won't break existing configuration files. - for a given rule, several named rules may have different status option
- when a warning rule match, just set a global warning boolean to true (without counting warnings)
- add a new exit code 252, which means one or more warnings have been encountered, but no errors
If you like the idea, I may implement this new feature.
I don't believe we want to continue exit codes being outside of the norm.
I also don't know that we want to add the complexity of a flag like this.
I agree on the non standard exit code, this is the kind of stuff hard to maintain. It seems there is no convention about warning exit code. However, I want to point out that gitlab hints to use 137 or 255 as non fatal exit status: https://docs.gitlab.com/ee/ci/yaml/#allow_failureexit_codes I admit this is not a convention, just an example in the documentation. But I am not alone :)
For the complexity, from my point of view, it seems not to be a big deal. But you know the project better than I.