[PATCH] scripts/checkpatch.pl: Only emit LONG_LINE for --strict

From: Josh Triplett
Date: Wed Jun 25 2014 - 12:55:05 EST


Regardless of the long-standing debate over line width, checkpatch
should not warn about it by default. Too many users run checkpatch and
blindly follow its recommendation by splitting long lines, which almost
invariably results in worse code. On rare occasions, the line-width
limit encourages sensible refactoring of nested code into functions, but
more frequently it just results in painfully over-wrapped code. Turning
this warning off by default will ensure that people who take the time to
fix up checkpatch issues in drivers (especially staging drivers) don't
waste time submitting patches that uglify code to quiet checkpatch's
line-width limit.

The on-by-default DEEP_INDENTATION warning for lines indented more than
6 levels deep makes more sense as a default, to encourage people to
refactor, since it cannot be "fixed" by simply reformatting code.

Signed-off-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 010b18e..b2eb968 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2146,8 +2146,8 @@ sub process {
$line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
$length > $max_line_length)
{
- WARN("LONG_LINE",
- "line over $max_line_length characters\n" . $herecurr);
+ CHK("LONG_LINE",
+ "line over $max_line_length characters\n" . $herecurr);
}

# Check for user-visible strings broken across lines, which breaks the ability
--
2.0.0

--
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/