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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 62B2DC433E7 for ; Thu, 15 Oct 2020 00:42:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1CDD22242 for ; Thu, 15 Oct 2020 00:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbgJOAmn (ORCPT ); Wed, 14 Oct 2020 20:42:43 -0400 Received: from smtprelay0136.hostedemail.com ([216.40.44.136]:52958 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726018AbgJOAmn (ORCPT ); Wed, 14 Oct 2020 20:42:43 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 0CDEA100E7B44; Thu, 15 Oct 2020 00:42:42 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: wave33_0e0ab4727210 X-Filterd-Recvd-Size: 1611 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Thu, 15 Oct 2020 00:42:41 +0000 (UTC) Message-ID: <7983b5dcb7f589e31fb954cfc1472a93244984fb.camel@perches.com> Subject: Re: [PATCH] checkpatch: add a fixer for missing newline at eof From: Joe Perches To: trix@redhat.com, apw@canonical.com Cc: linux-kernel@vger.kernel.org Date: Wed, 14 Oct 2020 17:42:40 -0700 In-Reply-To: <20201014211540.15732-1-trix@redhat.com> References: <20201014211540.15732-1-trix@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-10-14 at 14:15 -0700, trix@redhat.com wrote: > From: Tom Rix > > Remove the trailing error message from the fixed lines Hi Tom. > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3393,8 +3393,11 @@ sub process { > > # check for adding lines without a newline. > if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { > - WARN("MISSING_EOF_NEWLINE", > - "adding a line without newline at end of file\n" . $herecurr); > + if (WARN("MISSING_EOF_NEWLINE", > + "adding a line without newline at end of file\n" . $herecurr) && > + $fix) { > + fix_delete_line($fixlinenr+1, "No newline at end of file"); This is misindented, the 4 spaces before fix_delete_line should be a tab, otherwise this looks fine, thanks.