tools/checkpatch: enforce blank line after subject and add breaking-change checks#18426
Open
arjav1528 wants to merge 2 commits intoapache:masterfrom
Open
tools/checkpatch: enforce blank line after subject and add breaking-change checks#18426arjav1528 wants to merge 2 commits intoapache:masterfrom
arjav1528 wants to merge 2 commits intoapache:masterfrom
Conversation
…nforcement - Introduced a new flag '-b' to enforce breaking change format in commit messages. - Added checks to ensure that breaking change commits start with '!' and contain 'BREAKING CHANGE:' in the body before 'Signed-off-by'. - Updated usage instructions to reflect the new breaking change option. Signed-off-by: Arjav Patel <arjav1528@gmail.com>
…bels - Updated the check workflow to conditionally include a '-b' option for breaking change enforcement based on PR labels. - Modified the checkpatch script to support reading commit messages from stdin when using the '-m -g' flags. - Improved usage instructions to clarify the new stdin option for commit message checks. Signed-off-by: Arjav Patel <arjav1528@gmail.com>
5e10fa3 to
c0ed2ac
Compare
Contributor
Author
|
@maintainers, could anyone of you tell if my approach is correct or not |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17133
Summary
checkpatch.sh didnt require a blank line after the commit subject, so the length check could be bypassed by continuing the subject on line 2. The current changes require a blank second line and adds optional
-bbreaking-change checks (!in subject,BREAKING CHANGE:before sign-off). CI runs checkpatch with-bwhen the PR has the "breaking change" label.--stdinwith-m -gallows message-only checks from stdin.Impact
Commits that continued the subject on line 2 will now fail until a blank line is added. PRs with the "breaking change" label are validated in CI for the correct format. No build, hardware, or documentation impact.
Testing
Verified on macOS with
./tools/checkpatch.sh -m -g --stdin: bypass case is rejected, valid messages pass, and-bcorrectly enforces breaking-change format. Normal-m -g HEADpath and CI label logic were checked.