diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2019-03-22 17:11:37 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2019-03-25 12:44:43 -0400 |
commit | 6c5d24eef7be7adfcb608f2852ab69b58935133b (patch) | |
tree | 928ff8d79e566621ac2da8ce45825faf49d2bf1a /scripts | |
parent | c55760806d082ff9947560950cfd6cf180ab491e (diff) |
checkpatch: Warn on improper usage of Co-developed-by
The purpose of Co-developed-by: is to give attribution to authors who
aren't already attributed by the From: tag, i.e. who aren't the nominal
patch author. Because Co-developed-by: is essentially a variation of
From:, it must be accompanied by a Signed-off-by: of the associated
co-author. To ease the burden of determining whether or not co-authors
have signed off, Co-developed-by and Signed-off-by: must be explicitly
paired, i.e. on consecutive lines for a given co-author.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5b756278df13..bbe71f017f6d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2687,6 +2687,24 @@ sub process { | |||
2687 | } else { | 2687 | } else { |
2688 | $signatures{$sig_nospace} = 1; | 2688 | $signatures{$sig_nospace} = 1; |
2689 | } | 2689 | } |
2690 | |||
2691 | # Check Co-developed-by: immediately followed by Signed-off-by: with same name and email | ||
2692 | if ($sign_off =~ /^co-developed-by:$/i) { | ||
2693 | if ($email eq $author) { | ||
2694 | WARN("BAD_SIGN_OFF", | ||
2695 | "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline); | ||
2696 | } | ||
2697 | if (!defined $lines[$linenr]) { | ||
2698 | WARN("BAD_SIGN_OFF", | ||
2699 | "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline); | ||
2700 | } elsif ($rawlines[$linenr] !~ /^\s*signed-off-by:\s*(.*)/i) { | ||
2701 | WARN("BAD_SIGN_OFF", | ||
2702 | "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); | ||
2703 | } elsif ($1 ne $email) { | ||
2704 | WARN("BAD_SIGN_OFF", | ||
2705 | "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); | ||
2706 | } | ||
2707 | } | ||
2690 | } | 2708 | } |
2691 | 2709 | ||
2692 | # Check email subject for common tools that don't need to be mentioned | 2710 | # Check email subject for common tools that don't need to be mentioned |