admin管理员组文章数量:1391995
gitlint is a handy tool and for example useful to limit the max line length of commit messages to 72 characters - as widely adopted standard across many projects. However, this rule also doesn't allow me to insert long links anymore. What can I do to have the best of both worlds?
gitlint is a handy tool and for example useful to limit the max line length of commit messages to 72 characters - as widely adopted standard across many projects. However, this rule also doesn't allow me to insert long links anymore. What can I do to have the best of both worlds?
Share Improve this question edited Mar 13 at 6:25 phip1611 asked Mar 12 at 10:26 phip1611phip1611 6,2305 gold badges41 silver badges75 bronze badges 2- "limit commit messages to a length of 72 characters" - surely you mean the commit message title? – 1615903 Commented Mar 13 at 5:53
- 1 YIKES, thanks. I adapted the question. I was talking about the max line length – phip1611 Commented Mar 13 at 6:26
1 Answer
Reset to default 0An easy solution is to use the ignore-body-lines configuration property. We can use a regex for each line starting with the pattern http[s]://
. We then can ignore the body-max-line-length rule for that given case.
[body-max-line-length]
line-length=72
# Don't annoy users when they add long links to useful resources
[ignore-by-body]
regex=^https?:\/\/
ignore=body-max-line-length
Now your commit message can look like this:
fix: security vulnerability in xyz
The bug [0] is now solved using the solution presented in [1].
[0]
http://very-very-very-very-very-very-very-very-very-very-very-very-very.long.link
[1]
https://very-very-very-very-very-very-very-very-very-very-very-very-very.long.link
本文标签: gitConfigure gitlint to ignore long links when they exceed the maximum line lengthStack Overflow
版权声明:本文标题:git - Configure gitlint to ignore long links when they exceed the maximum line length - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744758849a2623627.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论