Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to flag rules as error or warning #290

Open
jreybert opened this issue May 20, 2022 · 2 comments
Open

Allow to flag rules as error or warning #290

jreybert opened this issue May 20, 2022 · 2 comments

Comments

@jreybert
Copy link

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 to error, 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.

@sigmavirus24
Copy link
Collaborator

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.

@jreybert
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants