gitlint icon indicating copy to clipboard operation
gitlint copied to clipboard

Allow regex in body-changed-file-mention

Open darnir opened this issue 7 years ago • 1 comments

My specific usecase is to use gitlint to lint commit messages which should follow the GNU Change Log guidelines (https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Style-of-Change-Logs).

These commit messages are run through a script which converts git log entries to a ChangeLog file for distribution.

One of the requirements of the ChangeLog is that every commit explicitly lists out all the files which were modified in that commit. So, I'd like for body-changed-file-mention to run for every single file in the git repository. A simple way to do that would be to allow the rule to be a regex, so that .* will cause the rule to be executed for all files.

darnir avatar Apr 01 '18 16:04 darnir

Hey, thanks for the suggestion. I like this idea.

Not sure when I'll get to it - it might take me a while. I'm wrapping up a few more commits for the upcoming 0.10.0 release, but I won't be able to get this in. There's typically a few months between releases - so that would be a rough timeline.

If you need something earlier than that, I'd recommend writing a custom rule: http://jorisroovers.github.io/gitlint/user_defined_rules/

You can basically copy-paste the existing body-changed-file-mention rule and modify it as you need: https://github.com/jorisroovers/gitlint/blob/master/gitlint/rules.py#L283-L297

Happy to accept PRs as well! (see http://jorisroovers.github.io/gitlint/contributing/)

jorisroovers avatar Apr 02 '18 07:04 jorisroovers