lkml.org 
[lkml]   [2020]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] checkpatch: add a fixer for missing newline at eof
From
Date
On Wed, 2020-10-14 at 14:15 -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> 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.


\
 
 \ /
  Last update: 2020-10-15 02:43    [W:0.028 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site