public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/checkpatch.pl: Only emit LONG_LINE for --strict
@ 2014-06-25 15:46 Josh Triplett
  2014-06-26  0:05 ` Joe Perches
  0 siblings, 1 reply; 12+ messages in thread
From: Josh Triplett @ 2014-06-25 15:46 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, gregkh, akpm; +Cc: linux-kernel

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@joshtriplett.org>
---
 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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-06-26  6:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 15:46 [PATCH] scripts/checkpatch.pl: Only emit LONG_LINE for --strict Josh Triplett
2014-06-26  0:05 ` Joe Perches
2014-06-26  2:24   ` Josh Triplett
2014-06-26  2:33     ` Joe Perches
2014-06-26  3:44       ` Josh Triplett
2014-06-26  4:16         ` Joe Perches
2014-06-26  5:08           ` Josh Triplett
2014-06-26  5:29             ` Joe Perches
2014-06-26  5:49               ` Josh Triplett
2014-06-26  3:59     ` Greg KH
2014-06-26  4:43       ` Josh Triplett
2014-06-26  6:52         ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox