ITADN

fix: inconsistency when handling comments

#4752ClosedEzall2001 创建于 2026-05-09
bug
E
Ezall2001commented
### Steps to Reproduce ```bash 1. when piping. cat .git/COMMIT_EDITMSG | pnpm commitlint ⧗ input: feat: test body not empty # a verrryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy long comment ✖ body's lines must not be longer than 72 characters [body-max-line-length] ✖ found 1 problems, 0 warnings 2. when using `--edit` (no error) pnpm commitlint --edit ``` ### Current Behavior It seems that piping the message directly to commitlint cli apply the rules on comments but using `--edit` filter them out as expected. Not sure if this is the intended behaviour, but if it is, can a flag be added to control when comments are ignored when not. ### Expected Behavior comments are ignored ### Affected packages - [x] cli - [x] core - [ ] prompt - [ ] config-angular ### Possible Solution add a flag to control when comments are ignored and when not. ### Context none-ls, a Neovim plugin that wraps tools like commitlint and exposes them as LSP sources, is affected by this issue in its commitlint builtin. It pipes raw buffer content to commitlint, which causes comment lines to be linted and triggers false positive diagnostics. ### commitlint --version @commitlint/cli@20.5.3 ### git --version git version 2.54.0 ### node --version v22.22.2
关闭于 2026-05-09 2 条评论