Files
qdl/commitlint.config.mjs
T
Igor Opaniuk e08f0eb42b commitlint: Recognize kernel-style trailers as footer items
The config relaxes footer-max-line-length to 200 specifically to
accommodate long Signed-off-by addresses, but commitlint's default
parser only treats `BREAKING CHANGE` as a note keyword. Other
kernel-style trailers (Fixes, Reviewed-by, Tested-by, ...) get
classified as body lines, so a trailer that exceeds 72 characters --
typically a `Fixes:` quoting a long commit subject -- trips
body-max-line-length even though the relaxed footer limit was meant
to cover exactly this case.

Configure parserPreset.parserOpts.noteKeywords with the trailer
tokens this project uses, so those lines move into the footer
section and inherit the existing footer-max-line-length=200 rule.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-05-11 10:15:48 -05:00

49 lines
1.6 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Commitlint config tuned for Linux kernel-style commit messages.
//
// Expected format:
// subsystem: short description (max 72 chars)
// <blank line>
// Body text wrapped at 72 chars.
// <blank line>
// Signed-off-by: Name <email>
export default {
rules: {
// Subject line limit (Linux kernel style uses up to 72)
'header-max-length': [2, 'always', 72],
// Body and footer lines wrapped at 72 chars.
// Footer limit is relaxed to 200 to accommodate long Signed-off-by
// addresses without false positives.
'body-max-line-length': [2, 'always', 72],
'footer-max-line-length': [2, 'always', 200],
// Require a blank line between subject and body, and before footers
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [2, 'always'],
// Disable Conventional Commits type rules - this project uses
// Linux kernel–style "subsystem: description" subjects instead.
'type-enum': [0],
'type-case': [0],
'type-empty': [0],
'scope-empty': [0],
'subject-case': [0],
},
// Teach the parser which trailers terminate the body and start the
// footer. Without this, kernel-style trailers like `Fixes:` are
// classified as body lines and trip body-max-line-length, while the
// relaxed footer-max-line-length (200) never gets a chance to apply.
parserPreset: {
parserOpts: {
noteKeywords: [
'BREAKING CHANGE', 'BREAKING-CHANGE',
'Fixes', 'Signed-off-by', 'Co-authored-by',
'Reviewed-by', 'Tested-by', 'Acked-by',
'Reported-by', 'Suggested-by',
],
},
},
};