fix(rules): ignore cherry-picks in signed-off-by#4625
fix(rules): ignore cherry-picks in signed-off-by#4625escapedcat merged 1 commit intoconventional-changelog:masterfrom
Conversation
Review Summary by QodoFix signed-off-by rule to ignore cherry-pick trailers
WalkthroughsDescription• Fixes signed-off-by rule rejecting cherry-picked commits • Filters out cherry-pick trailer lines during validation • Adds test case for cherry-pick scenario Diagramflowchart LR
A["Cherry-picked commit"] -->|"contains cherry-pick trailer"| B["signed-off-by rule"]
B -->|"filters cherry-pick lines"| C["validates Signed-off-by presence"]
C -->|"passes validation"| D["commit accepted"]
File Changes1. @commitlint/rules/src/signed-off-by.ts
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Code Review by Qodo
1. Cherry-pick pattern missing parenthesis
|
17e82a7 to
2bc5354
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the signed-off-by rule where cherry-picked commits were incorrectly rejected. The rule now treats cherry-picked commits the same as regular commits by filtering out the cherry-pick trailer line when checking if the last line is a "Signed-off-by" trailer.
Changes:
- Modified the
signed-off-byrule to skip lines starting with "(cherry picked from commit" when determining the last meaningful line - Added test coverage to verify that cherry-pick markers are properly ignored
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| @commitlint/rules/src/signed-off-by.ts | Added filter to skip cherry-pick trailer lines |
| @commitlint/rules/src/signed-off-by.test.ts | Added test case and test data for cherry-pick scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks! Please have a look at the open comments |
2bc5354 to
e8be3cc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Some more comments. Have a look and tackle what's valid please, thanks! |
Before this change, the rule `signed-off-by` was rejecting cherry picked commits. The cherry pick message wasn't appearing as the last line. With this in place, the rule will treat cherry picked commits as regular commits. Signed-off-by: Manuel Zedel <[email protected]>
e8be3cc to
08471b7
Compare
|
@escapedcat thanks for looking into this! |
You're welcome! copilot reviews are really helpful. |
This PR contains the following updates: | Package | Type | Update | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [alpine/helm](https://github.com/alpine-docker/helm) ([changelog](https://github.com/helm/helm)) | | patch | `3.20.0` → `3.20.1` |  |  | | [alpine/helm](https://github.com/alpine-docker/helm) ([changelog](https://github.com/helm/helm)) | container | patch | `3.20.0` → `3.20.1` |  |  | | [commitlint/commitlint](https://github.com/conventional-changelog/commitlint) | container | minor | `20.4.1` → `20.5.1` |  |  | | [docker.io/thegeeklab/git-sv](https://github.com/thegeeklab/git-sv) | container | patch | `2.0.9` → `2.0.11` |  |  | | [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) | devDependencies | minor | [`^0.47.0` → `^0.48.0`](https://renovatebot.com/diffs/npm/markdownlint-cli/0.47.0/0.48.0) |  |  | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (commitlint/commitlint)</summary> ### [`v20.5.1`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2051-2026-03-31) [Compare Source](conventional-changelog/commitlint@v20.5.0...v20.5.1) ##### Bug Fixes - **cz-commitlint:** add VS16 to single character emojis ([#​4666](conventional-changelog/commitlint#4666)) ([9e3e2d3](conventional-changelog/commitlint@9e3e2d3)) - **cz-commitlint:** handle modifiers correctly ([#​4667](conventional-changelog/commitlint#4667)) ([5a3ebf5](conventional-changelog/commitlint@5a3ebf5)) - update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671)) ([a300d32](conventional-changelog/commitlint@a300d32)) ##### Reverts - Revert "fix: update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671))" ([#​4677](conventional-changelog/commitlint#4677)) ([0f124c9](conventional-changelog/commitlint@0f124c9)), closes [#​4671](conventional-changelog/commitlint#4671) [#​4677](conventional-changelog/commitlint#4677) ### [`v20.5.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2050-2026-03-15) [Compare Source](conventional-changelog/commitlint@v20.4.4...v20.5.0) ##### Bug Fixes - **cli:** validate that --cwd directory exists before execution ([#​4658](conventional-changelog/commitlint#4658)) ([cf80f75](conventional-changelog/commitlint@cf80f75)), closes [#​4595](conventional-changelog/commitlint#4595) - **load:** resolve async config exports in CJS projects ([#​4659](conventional-changelog/commitlint#4659)) ([fce263f](conventional-changelog/commitlint@fce263f)), closes [#​4557](conventional-changelog/commitlint#4557) - **resolve-extends:** always resolve extended parser presets for proper merging ([#​4647](conventional-changelog/commitlint#4647)) ([e9ef76c](conventional-changelog/commitlint@e9ef76c)), closes [#​4640](conventional-changelog/commitlint#4640) ##### Features - **cz-commitlint:** add exclamation mark support for breaking changes ([#​4655](conventional-changelog/commitlint#4655)) ([3b124a7](conventional-changelog/commitlint@3b124a7)) #### [20.4.4](conventional-changelog/commitlint@v20.4.3...v20.4.4) (2026-03-12) ##### Bug Fixes - **is-ignored:** strip CI skip markers from release commits ([#​4637](conventional-changelog/commitlint#4637)) ([56a6fd0](conventional-changelog/commitlint@56a6fd0)) - **read:** update git-raw-commits to v5 API ([#​4638](conventional-changelog/commitlint#4638)) ([bd6ab41](conventional-changelog/commitlint@bd6ab41)) - **types:** allow context parameter in QualifiedRuleConfig functions ([#​4636](conventional-changelog/commitlint#4636)) ([17537ae](conventional-changelog/commitlint@17537ae)), closes [#​4357](conventional-changelog/commitlint#4357) #### [20.4.3](conventional-changelog/commitlint@v20.4.2...v20.4.3) (2026-03-03) ##### Bug Fixes - footer parser does not escape special chars for regex [#​4560](conventional-changelog/commitlint#4560) ([#​4634](conventional-changelog/commitlint#4634)) ([8ff7c7f](conventional-changelog/commitlint@8ff7c7f)) - npx usage [#​613](conventional-changelog/commitlint#613) ([#​4630](conventional-changelog/commitlint#4630)) ([1644f1e](conventional-changelog/commitlint@1644f1e)), closes [#​3](conventional-changelog/commitlint#3) [#​1](conventional-changelog/commitlint#1) [#​2](conventional-changelog/commitlint#2) [#​4](conventional-changelog/commitlint#4) [#​5](conventional-changelog/commitlint#5) [#​7](conventional-changelog/commitlint#7) [#​6](conventional-changelog/commitlint#6) - **types:** incorrect types for rule options ([#​4633](conventional-changelog/commitlint#4633)) ([77b85f2](conventional-changelog/commitlint@77b85f2)) #### [20.4.2](conventional-changelog/commitlint@v20.4.1...v20.4.2) (2026-02-19) ##### Bug Fixes - **config-nx-scopes:** add unique names to fixture projects ([#​4622](conventional-changelog/commitlint#4622)) ([5635cf0](conventional-changelog/commitlint@5635cf0)) - **rules:** ignore cherry-picks in signed-off-by ([#​4625](conventional-changelog/commitlint#4625)) ([691a52d](conventional-changelog/commitlint@691a52d)) #### [20.4.1](conventional-changelog/commitlint@v20.4.0...v20.4.1) (2026-02-02) ##### Reverts - replace all lodash string methods with kasi [#​4602](conventional-changelog/commitlint#4602) ([#​4621](conventional-changelog/commitlint#4621)) ([5326ab9](conventional-changelog/commitlint@5326ab9)), closes [#​4620](conventional-changelog/commitlint#4620) [#​4620](conventional-changelog/commitlint#4620) ### [`v20.4.4`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2044-2026-03-12) [Compare Source](conventional-changelog/commitlint@v20.4.3...v20.4.4) ##### Bug Fixes - **is-ignored:** strip CI skip markers from release commits ([#​4637](conventional-changelog/commitlint#4637)) ([56a6fd0](conventional-changelog/commitlint@56a6fd0)) - **read:** update git-raw-commits to v5 API ([#​4638](conventional-changelog/commitlint#4638)) ([bd6ab41](conventional-changelog/commitlint@bd6ab41)) - **types:** allow context parameter in QualifiedRuleConfig functions ([#​4636](conventional-changelog/commitlint#4636)) ([17537ae](conventional-changelog/commitlint@17537ae)), closes [#​4357](conventional-changelog/commitlint#4357) ### [`v20.4.3`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2043-2026-03-03) [Compare Source](conventional-changelog/commitlint@v20.4.2...v20.4.3) ##### Bug Fixes - footer parser does not escape special chars for regex [#​4560](conventional-changelog/commitlint#4560) ([#​4634](conventional-changelog/commitlint#4634)) ([8ff7c7f](conventional-changelog/commitlint@8ff7c7f)) - npx usage [#​613](conventional-changelog/commitlint#613) ([#​4630](conventional-changelog/commitlint#4630)) ([1644f1e](conventional-changelog/commitlint@1644f1e)), closes [#​3](conventional-changelog/commitlint#3) [#​1](conventional-changelog/commitlint#1) [#​2](conventional-changelog/commitlint#2) [#​4](conventional-changelog/commitlint#4) [#​5](conventional-changelog/commitlint#5) [#​7](conventional-changelog/commitlint#7) [#​6](conventional-changelog/commitlint#6) - **types:** incorrect types for rule options ([#​4633](conventional-changelog/commitlint#4633)) ([77b85f2](conventional-changelog/commitlint@77b85f2)) ### [`v20.4.2`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2042-2026-02-19) [Compare Source](conventional-changelog/commitlint@v20.4.1...v20.4.2) ##### Bug Fixes - **config-nx-scopes:** add unique names to fixture projects ([#​4622](conventional-changelog/commitlint#4622)) ([5635cf0](conventional-changelog/commitlint@5635cf0)) - **rules:** ignore cherry-picks in signed-off-by ([#​4625](conventional-changelog/commitlint#4625)) ([691a52d](conventional-changelog/commitlint@691a52d)) </details> <details> <summary>thegeeklab/git-sv (docker.io/thegeeklab/git-sv)</summary> ### [`v2.0.11`](https://github.com/thegeeklab/git-sv/releases/tag/v2.0.11) [Compare Source](thegeeklab/git-sv@v2.0.10...v2.0.11) #### v2.0.11 (2026-03-29) ##### Bug Fixes - parse multiline breaking changes correctly ([#​297](thegeeklab/git-sv#297)) ([`7898fb6`](thegeeklab/git-sv@7898fb6)) - **deps:** update module github.com/rs/zerolog to v1.35.0 ([#​294](thegeeklab/git-sv#294)) ([`2a091dd`](thegeeklab/git-sv@2a091dd)) ##### Others - **deps:** bump github.com/cloudflare/circl from 1.6.1 to 1.6.3 ([#​296](thegeeklab/git-sv#296)) ([`909ad60`](thegeeklab/git-sv@909ad60)) - improve test coverage ([#​295](thegeeklab/git-sv#295)) ([`de86f6c`](thegeeklab/git-sv@de86f6c)) - **deps:** update dependency golangci/golangci-lint to v2.11.4 ([#​293](thegeeklab/git-sv#293)) ([`e5663e5`](thegeeklab/git-sv@e5663e5)) - **docker:** update docker.io/library/golang:1.26.1 docker digest to [`595c784`](thegeeklab/git-sv@595c784) ([#​292](thegeeklab/git-sv#292)) ([`21374a6`](thegeeklab/git-sv@21374a6)) - **docker:** update docker.io/library/golang:1.26.1 docker digest to [`c42e4d7`](thegeeklab/git-sv@c42e4d7) ([#​291](thegeeklab/git-sv#291)) ([`d7c21aa`](thegeeklab/git-sv@d7c21aa)) ##### CI Pipeline - use trivy image from ghcr ([`4261c0f`](thegeeklab/git-sv@4261c0f)) ### [`v2.0.10`](https://github.com/thegeeklab/git-sv/releases/tag/v2.0.10) [Compare Source](thegeeklab/git-sv@v2.0.9...v2.0.10) #### v2.0.10 (2026-03-12) ##### Bug Fixes - **deps:** update module github.com/urfave/cli/v3 to v3.7.0 ([#​287](thegeeklab/git-sv#287)) ([`fa50899`](thegeeklab/git-sv@fa50899)) - **deps:** update module github.com/urfave/cli/v3 to v3.6.2 ([#​274](thegeeklab/git-sv#274)) ([`db378fd`](thegeeklab/git-sv@db378fd)) - **deps:** update module github.com/goccy/go-yaml to v1.19.2 ([#​270](thegeeklab/git-sv#270)) ([`c0e650d`](thegeeklab/git-sv@c0e650d)) - **deps:** update module github.com/goccy/go-yaml to v1.19.1 ([#​266](thegeeklab/git-sv#266)) ([`b7974ba`](thegeeklab/git-sv@b7974ba)) ##### Others - **deps:** update dependency golangci/golangci-lint to v2.11.3 ([#​290](thegeeklab/git-sv#290)) ([`bfc4e71`](thegeeklab/git-sv@bfc4e71)) - **deps:** update golang patch version ([#​289](thegeeklab/git-sv#289)) ([`e17551c`](thegeeklab/git-sv@e17551c)) - **docker:** update docker.io/library/golang:1.26.0 docker digest to [`fb612b7`](thegeeklab/git-sv@fb612b7) ([#​288](thegeeklab/git-sv#288)) ([`3474fb1`](thegeeklab/git-sv@3474fb1)) - **docker:** update docker.io/library/golang:1.26.0 docker digest to [`9edf713`](thegeeklab/git-sv@9edf713) ([#​286](thegeeklab/git-sv#286)) ([`f72ce98`](thegeeklab/git-sv@f72ce98)) - **docker:** update docker.io/library/golang:1.26.0 docker digest to [`a9c4aac`](thegeeklab/git-sv@a9c4aac) ([#​285](thegeeklab/git-sv#285)) ([`886ff59`](thegeeklab/git-sv@886ff59)) - **deps:** update dependency golangci/golangci-lint to v2.10.1 ([#​283](thegeeklab/git-sv#283)) ([`009cee1`](thegeeklab/git-sv@009cee1)) - **deps:** update docker.io/lycheeverse/lychee docker tag to v0.23 ([#​284](thegeeklab/git-sv#284)) ([`d67f814`](thegeeklab/git-sv@d67f814)) - **deps:** update golang version ([#​279](thegeeklab/git-sv#279)) ([`562e6b6`](thegeeklab/git-sv@562e6b6)) - **deps:** update dependency golangci/golangci-lint to v2.9.0 ([#​282](thegeeklab/git-sv#282)) ([`0fa44b0`](thegeeklab/git-sv@0fa44b0)) - **docker:** update docker.io/library/golang:1.25.7 docker digest to [`85c0ab0`](thegeeklab/git-sv@85c0ab0) ([#​280](thegeeklab/git-sv#280)) ([`15e0180`](thegeeklab/git-sv@15e0180)) - **deps:** update golang patch version ([#​278](thegeeklab/git-sv#278)) ([`57eb5f1`](thegeeklab/git-sv@57eb5f1)) - **docker:** update docker.io/library/golang:1.25.6 docker digest to [`06d1251`](thegeeklab/git-sv@06d1251) ([#​277](thegeeklab/git-sv#277)) ([`d3620b6`](thegeeklab/git-sv@d3620b6)) - **docker:** update docker.io/library/alpine:3.23 docker digest to [`2510918`](thegeeklab/git-sv@2510918) ([#​276](thegeeklab/git-sv#276)) ([`17b4167`](thegeeklab/git-sv@17b4167)) - fix lychee and use yaml file extension ([`cadbc7b`](thegeeklab/git-sv@cadbc7b)) - **docker:** update docker.io/library/golang:1.25.6 docker digest to [`ce63a16`](thegeeklab/git-sv@ce63a16) ([#​275](thegeeklab/git-sv#275)) ([`ede5c73`](thegeeklab/git-sv@ede5c73)) - **deps:** update golang patch version ([#​273](thegeeklab/git-sv#273)) ([`9937fcf`](thegeeklab/git-sv@9937fcf)) - **docker:** update docker.io/library/golang:1.25.5 docker digest to [`8bbd140`](thegeeklab/git-sv@8bbd140) ([#​272](thegeeklab/git-sv#272)) ([`3938585`](thegeeklab/git-sv@3938585)) - **deps:** update dependency golangci/golangci-lint to v2.8.0 ([#​271](thegeeklab/git-sv#271)) ([`411d457`](thegeeklab/git-sv@411d457)) - **docker:** update docker.io/library/golang:1.25.5 docker digest to [`6cc2338`](thegeeklab/git-sv@6cc2338) ([#​269](thegeeklab/git-sv#269)) ([`4b858a5`](thegeeklab/git-sv@4b858a5)) - **docker:** update docker.io/library/golang:1.25.5 docker digest to [`31c1e53`](thegeeklab/git-sv@31c1e53) ([#​268](thegeeklab/git-sv#268)) ([`bc5174b`](thegeeklab/git-sv@bc5174b)) - **docker:** update docker.io/library/alpine:3.23 docker digest to [`865b95f`](thegeeklab/git-sv@865b95f) ([#​267](thegeeklab/git-sv#267)) ([`5b2b90e`](thegeeklab/git-sv@5b2b90e)) - **docker:** update docker.io/library/golang:1.25.5 docker digest to [`36b4f45`](thegeeklab/git-sv@36b4f45) ([#​265](thegeeklab/git-sv#265)) ([`d20165f`](thegeeklab/git-sv@d20165f)) - **docker:** update docker.io/library/golang:1.25.5 docker digest to [`a22b2e6`](thegeeklab/git-sv@a22b2e6) ([#​264](thegeeklab/git-sv#264)) ([`c54bb89`](thegeeklab/git-sv@c54bb89)) - **docker:** update docker.io/library/golang:1.25.5 docker digest to [`68ee6df`](thegeeklab/git-sv@68ee6df) ([#​263](thegeeklab/git-sv#263)) ([`caafd3d`](thegeeklab/git-sv@caafd3d)) - **deps:** update dependency golangci/golangci-lint to v2.7.2 ([#​262](thegeeklab/git-sv#262)) ([`c23a505`](thegeeklab/git-sv@c23a505)) ##### CI Pipeline - drop notify workflow ([`df67269`](thegeeklab/git-sv@df67269)) - unify golangci config ([`f450ce8`](thegeeklab/git-sv@f450ce8)) - drop prealloc linter ([`f6354f7`](thegeeklab/git-sv@f6354f7)) </details> <details> <summary>igorshubovych/markdownlint-cli (markdownlint-cli)</summary> ### [`v0.48.0`](https://github.com/igorshubovych/markdownlint-cli/releases/tag/v0.48.0) [Compare Source](igorshubovych/markdownlint-cli@v0.47.0...v0.48.0) - Update all dependencies via `Dependabot` </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Only on Sunday and Saturday (`* * * * 0,6`) - Automerge - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNi4yIiwidXBkYXRlZEluVmVyIjoiNDMuMTA0LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImtpbmQvZGVwZW5kZW5jeSJdfQ==--> Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/99 Reviewed-by: DaanSelen <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
Description
Before this change, the rule
signed-off-bywas rejecting cherry picked commits, as the cherry pick message wasn't appearing as the last line. With this in place, the rule will treat cherry picked commits just the same as regular commits.Motivation and Context
Addresses #2704 to remove the need for the
trailer-existsworkaround.Usage examples
or with the current change:
How Has This Been Tested?
I added a unit-test, watched it fail and then fixed the implementation to make the test pass.
Types of changes
Checklist: