Re: [PATCH] scripts/checkpatch.pl: added test for repeated lines
From: Joe Perches
Date: Sun Jul 10 2011 - 14:50:09 EST
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...
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/