Skip to contentSkip to conversation

checkpatch.pl: remove the punch card limit

PATCH In review Stefani Seibold 2 participants 3 messages Jan 6, 2010 – Jan 7, 2010 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch.pl: remove the punch card limit

The time of 80 characters punch card and terminals are over, so i would be a good thing to set the line length limit to 120. Every display today should be able handle this. And it think it make formated source code more readable.

For everybody who want know: The 80 column limit of a terminal comes from the punch cards, which stored exact 80 characters.

---
 checkpatch.pl |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/checkpatch.pl +3 -3
@@ -1374,13 +1374,13 @@ sub process {
 # check we are in a valid source file if not then ignore this hunk
 		next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
 
-#80 column limit
+#120 column limit
 		if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
 		    $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
 		    $line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
-		    $length > 80)
+		    $length > 120)
 		{
-			WARN("line over 80 characters\n" . $herecurr);
+			WARN("line over 120 characters\n" . $herecurr);
 		}
 
 # check for adding lines without a newline.
#1 lore raw
Quoted 7 lines · Stefani Seibold

The time of 80 characters punch card and terminals are over, so i would be a good thing to set the line length limit to 120. Every display today should be able handle this. And it think it make formated source code more readable.

For everybody who want know: The 80 column limit of a terminal comes from the punch cards, which stored exact 80 characters.

It doesn't really matter where it came from, what matters is whether people still commonly use 80-column windows or not.

I know people that only ever use one (huuuge) full-screen editor window with small fonts, and can happily view lines that are 300 characters long (of course, the right 80% of that window is almost always completely blank...).

In my case, I use 80-column windows because (1) it allows me to have two editor/terminal windows side-by-side with a reasonable font-size on a typical display, (2) it reduces the amount of wasted blank space in editor/terminal windows that you'd have if you made your windows really wide just for the very occasional wide line, and (3) it's, well, standard, or at least as much of a standard as we have, which is useful when interacting with other people.

Anyway, I think the vague consensus seems to be that it's OK to go over 80 chars in many cases, but that it may be an indicator that some refactoring is in order....

-Miles

Signature · 1 line
80% of success is just showing up.  --Woody Allen
#2 lore raw

Am Donnerstag, den 07.01.2010, 12:07 +0900 schrieb Miles Bader:

Quoted 9 lines
Quoted 4 lines · Stefani Seibold

The time of 80 characters punch card and terminals are over, so i would be a good thing to set the line length limit to 120. Every display today should be able handle this. And it think it make formated source code more readable.

Anyway, I think the vague consensus seems to be that it's OK to go over 80 chars in many cases, but that it may be an indicator that some refactoring is in order....

That's why i didn't removed the check. 120 character should be good, it should be not an indicator for refactoring. Especial with tab width of 8.

Stefani