]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
support/scripts: Add additional recognised Git trailers to checkpatch
authorAlexander Jung <alex@unikraft.io>
Mon, 8 May 2023 07:43:37 +0000 (07:43 +0000)
committerUnikraft <monkey@unikraft.io>
Wed, 10 May 2023 09:40:20 +0000 (09:40 +0000)
This commit introduces 3 additional Git trailers to be recognised by the
checkpatch program:

 - GitHub-Fixes   - Used to reference and address an open issue, often
                    a specific bug or problem. GitHub will automatically
                    close the issue once the commit with this Git
                    trailer is merged.
 - GitHub-Closes  - Used to reference an open issue or PR, which is not
                    specific to a particular bug.  For example, it can
                    be used to supercede another PR.  GitHub will
                    automatically close the referenced issue or PR once
                    a commit with this Git trailer is merged.
 - Co-authored-by - Similar to providing additional Signed-off-by's,
                    this trailer is recognised by GitHub and helps
                    attribute authorship, making the user's profile
                    more visible.
 - Approved-by    - Signifies the authoritive representative (usually a
                    project maintainer) who approved the commit.

Additional adjustments to the checkpatch script are made in order to
recognise non-standard Git trailer values (those from GitHub).

Signed-off-by: Alexander Jung <alex@unikraft.io>
Reviewed-by: Gabi Mocanu <gabi.mocanu98@gmail.com>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Reviewed-by: Gabi Mocanu <gabi.mocanu98@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #879

support/scripts/checkpatch.pl

index d66b04b862e22c2284f35af43331442620d5b4db..127cd6efd9ebc6ffba28fde272b5bb33924e53af 100755 (executable)
@@ -467,6 +467,10 @@ our $signature_tags = qr{(?xi:
        Reviewed-by:|
        Reported-by:|
        Suggested-by:|
+       Approved-by:|
+       Co-authored-by:|
+       GitHub-Fixes:|
+       GitHub-Closes:|
        To:|
        Cc:
 )};
@@ -2461,7 +2465,8 @@ sub process {
 
 # Check signature styles
                if (!$in_header_lines &&
-                   $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {
+                   $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i &&
+                   $line !~ /^GitHub\s*/i) {
                        my $space_before = $1;
                        my $sign_off = $2;
                        my $space_after = $3;