[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c0751bb7fba5984ec4c7a14bc2cf924f1656e835.camel@perches.com>
Date: Tue, 10 Nov 2020 12:19:50 -0800
From: Joe Perches <joe@...ches.com>
To: Aditya Srivastava <yashsri421@...il.com>
Cc: lukas.bulwahn@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: add fix option for MISSING_SIGN_OFF
On Wed, 2020-11-11 at 00:36 +0530, Aditya Srivastava wrote:
> Currently checkpatch warns us if there is no 'Signed-off-by' line
> for the patch.
trivial style and a comment:
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2755,6 +2757,10 @@ sub process {
> if ($line =~ /^---$/) {
> $has_patch_separator = 1;
> $in_commit_log = 0;
> + # to add missing sign off line before diff(s)
> + if($patch_separator_linenr == 0) {
space after if
> + $patch_separator_linenr = $linenr;
> + }
[]
> @@ -7118,9 +7127,12 @@ sub process {
> "Does not appear to be a unified-diff format patch\n");
> }
> if ($is_patch && $has_commit_log && $chk_signoff) {
> - if ($signoff == 0) {
> - ERROR("MISSING_SIGN_OFF",
> - "Missing Signed-off-by: line(s)\n");
> + if ($signoff == 0 && !$non_standard_signature) {
> + if (ERROR("MISSING_SIGN_OFF",
> + "Missing Signed-off-by: line(s)\n") &&
> + $fix) {
> + fix_insert_line($patch_separator_linenr - 1, "Signed-off-by: $author");
Perhaps this needs to test $patch_separator_linenr to
make sure it's not 0.
Powered by blists - more mailing lists