2010-01-06 16:56:51

by Stefani Seibold

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Stefani Seibold <[email protected]>
---
checkpatch.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.33-rc2.orig/scripts/checkpatch.pl 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.33-rc2.new/scripts/checkpatch.pl 2010-01-06 17:46:40.057565661 +0100
@@ -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.




2010-01-07 03:11:14

by Miles Bader

[permalink] [raw]
Subject: Re: [PATCH] checkpatch.pl: remove the punch card limit

Stefani Seibold <[email protected]> writes:
> 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

--
80% of success is just showing up. --Woody Allen

2010-01-07 07:32:57

by Stefani Seibold

[permalink] [raw]
Subject: Re: [PATCH] checkpatch.pl: remove the punch card limit

Am Donnerstag, den 07.01.2010, 12:07 +0900 schrieb Miles Bader:
> Stefani Seibold <[email protected]> writes:
> > 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