lkml.org 
[lkml]   [2011]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scripts/checkpatch.pl: added test for repeated lines
From
Date
On Sun, 2011-07-10 at 20:18 +0200, Edwin van Vliet wrote:
> Repeated lines may indicate a bug or code that needs clarification. If the
> repeated line is intentional, an extra comment may be helpful for reviewers
> since the repeated pattern is likely to draw attention.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -1479,6 +1479,11 @@ sub process {
> +# check for repeated lines which may indicate bugs or lack of clarity
> + if ($rawline eq $prevrawline) {
> + WARN("repeated line\n" . $herecurr);
> + }
> +

Interest concept, but I think it needs to check for
comment lines and blank lines and such.

Also, there are uses of appropriate multiple close braces
on consecutive lines like:

switch (foo) {
case bar: {
etc...
}
}





\
 
 \ /
  Last update: 2011-07-10 20:53    [W:0.023 / U:3.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site