lkml.org 
[lkml]   [2019]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] checkpatch: add --fix for warning LINE_CONTINUATIONS
From
Date
On Wed, 2019-05-08 at 14:27 +0200, Antonio Borneo wrote:
> The warning LINE_CONTINUATIONS does not offer a --fix.
>
> Add the trivial --fix.
> In case of consecutive lines with the same issue, this will
> fix only the first line.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -5207,8 +5207,11 @@ sub process {
> $line !~ /^\+\s*\#.*\\$/ && # preprocessor
> $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
> $line =~ /^\+.*\\$/) {
> - WARN("LINE_CONTINUATIONS",
> - "Avoid unnecessary line continuations\n" . $herecurr);
> + if (WARN("LINE_CONTINUATIONS",
> + "Avoid unnecessary line continuations\n" . $herecurr) &&

I prefer to not apply this.

Problem here is that these should generally be fixed by hand
as the automated fix isn't very good style either.

> + $fix) {
> + $fixed[$fixlinenr] =~ s/\s*\\$//;
> + }
> }
> }
>

\
 
 \ /
  Last update: 2019-05-08 16:20    [W:0.095 / U:4.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site