ITADN

feat: align config-conventional body and footer limits with the specification

#4908Openlewxdev 创建于 2026-07-25
L
lewxdevcommented
### Expected Behavior `@commitlint/config-conventional` should not enforce maximum line lengths for commit bodies or footers by default, or it should clearly identify those rules as additional house-style constraints rather than requirements of Conventional Commits. [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/#specification) defines the body as free-form and allows footer values to contain spaces and newlines. It does not define maximum line lengths for either field. ### Current Behavior The preset enables these rules as errors with a limit of 100 characters: ```js "body-max-line-length": [2, "always", 100], "footer-max-line-length": [2, "always", 100], ``` As a result, a Conventional Commits-compliant message can fail unless every consumer explicitly disables both rules: ```js rules: { "body-max-line-length": [0], "footer-max-line-length": [0], }, ``` ### Affected packages - [ ] cli - [ ] core - [ ] prompt - [ ] config-angular The affected package is `@commitlint/config-conventional`, which is not listed in the current issue form. ### Possible Solution Disable these two rules in `@commitlint/config-conventional` by default in a future major release while keeping the rules available for projects that want line-length policy. If the existing behavior is intentionally part of Commitlint's house style, alternatives could be: - clearly documenting the difference from the Conventional Commits specification; or - providing a spec-focused preset without the additional length constraints. ### Context We preserve useful context in commit bodies and use standard Git trailers such as `Co-authored-by`. Valid body paragraphs, URLs, prompts, and trailer values can naturally exceed 100 characters. I searched existing reports including [#2112](https://github.com/conventional-changelog/commitlint/issues/2112), [#2930](https://github.com/conventional-changelog/commitlint/issues/2930), [#4088](https://github.com/conventional-changelog/commitlint/issues/4088), and [#4627](https://github.com/conventional-changelog/commitlint/issues/4627). Those discuss long URLs, disabling maximum lengths, parsing boundaries, or particular trailers, but do not address whether these defaults should differ from the specification.
0 条评论