mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: trix@redhat.com, apw@canonical.com,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] checkpatch: add a fixer for missing newline at eof
Date: Sat, 17 Oct 2020 07:27:25 -0700	[thread overview]
Message-ID: <25b86b7d30a3a94faf4e7279bcc34af1c522303f.camel@perches.com> (raw)
In-Reply-To: <20201017142546.28988-1-trix@redhat.com>

On Sat, 2020-10-17 at 07:25 -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
> 
> Remove the trailing error message from the fixed lines
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> v2: fix whitespace

Thanks Tom.  Andrew can you pick this up please?

> ---
>  scripts/checkpatch.pl | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index fab38b493cef..f9e78a5385ad 100755
> --- 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");
> +			}
>  		}
>  
>  # check we are in a valid source file C or perl if not then ignore this hunk


      reply	other threads:[~2020-10-17 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 14:25 trix
2020-10-17 14:27 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25b86b7d30a3a94faf4e7279bcc34af1c522303f.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®