From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80602C388F7 for ; Tue, 10 Nov 2020 20:19:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FEC320781 for ; Tue, 10 Nov 2020 20:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731557AbgKJUTx (ORCPT ); Tue, 10 Nov 2020 15:19:53 -0500 Received: from smtprelay0217.hostedemail.com ([216.40.44.217]:37880 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726179AbgKJUTx (ORCPT ); Tue, 10 Nov 2020 15:19:53 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 9C669180A8128; Tue, 10 Nov 2020 20:19:52 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: nose45_0f11056272f7 X-Filterd-Recvd-Size: 2001 Received: from [192.168.0.160] (cpe-72-134-80-165.natsow.res.rr.com [72.134.80.165]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Tue, 10 Nov 2020 20:19:51 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: add fix option for MISSING_SIGN_OFF From: Joe Perches To: Aditya Srivastava Cc: lukas.bulwahn@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Date: Tue, 10 Nov 2020 12:19:50 -0800 In-Reply-To: <20201110190603.2193-1-yashsri421@gmail.com> References: <20201110190603.2193-1-yashsri421@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.