mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: improve gitlint (max line length in body with exceptions)
Follow-up of 5aa1540c5d but way more
mature. We now use custom gitlint rules written in Python to better
handle the max line length, with respect to a few valid exceptions.
Recognizing code blocks or compiler output, as discussed, is not
trivial and hard to get right for all corner-cases. Therefore, this
commit is a pragmatic way forward. The CI job should be kept optional.
Allowed exceptions for the 72 line length limit are now:
1. links in the following three common patterns:
https://example.com/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links
[0] https://example.com/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links
[0]: https://example.com/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links/very-long-links
2. code blocks (anything between the three backticks)
```
let x = "very_long_very_long_very_long_very_long_very_long_very_long_very_long_very_long_very_long_very_long_"
```
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
f16d45e86e
commit
77e042237d
11
.gitlint
11
.gitlint
@@ -1,6 +1,7 @@
|
||||
[general]
|
||||
extra-path=scripts/gitlint/rules.py
|
||||
extra-path=scripts/gitlint/rules
|
||||
regex-style-search=true
|
||||
ignore=body-max-line-length
|
||||
|
||||
[ignore-by-author-name]
|
||||
regex=dependabot
|
||||
@@ -10,11 +11,3 @@ ignore=all
|
||||
[title-max-length]
|
||||
line-length=72
|
||||
|
||||
# default 80
|
||||
[body-max-line-length]
|
||||
line-length=72
|
||||
|
||||
# Allow developers to add long links to useful resources
|
||||
[ignore-by-body]
|
||||
regex=^https?:\/\/
|
||||
ignore=body-max-line-length
|
||||
|
||||
Reference in New Issue
Block a user