mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kevin granade <kevin.granade@gmail.com>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Valdis.Kletnieks@vt.edu, Mikulas Patocka <mpatocka@redhat.com>,
	Paul Mundt <lethal@linux-sh.org>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Alasdair G Kergon <agk@redhat.com>,
	dm-devel@redhat.com
Subject: Re: [PATCH] Drop 80-character limit in checkpatch.pl
Date: Fri, 18 Dec 2009 08:52:48 -0600	[thread overview]
Message-ID: <7004b08e0912180652p42777da3h70906f2fbdb60a69@mail.gmail.com> (raw)
In-Reply-To: <m3my1g1hmr.fsf@intrepid.localdomain>

On Fri, Dec 18, 2009 at 8:28 AM, Krzysztof Halasa <khc@pm.waw.pl> wrote:
> Valdis.Kletnieks@vt.edu writes:
>
>> Yeah, but I respectfully submit that if the regexp '^\t{6}' matches a non-
>> continuation line, it's probably in its rights to whinge.
>
> Yes, but don't make it a hard error, only a suggestion that something is
> probably really wrong.
>
>> fs/reisersfs/do_balan.c, lines 460-477 (note: 3 leading tabs elided)
>>
>>                               leaf_paste_entries(&bi,
>>                                                  n +
>>                                                  item_pos
>>                                                  -
>>                                                  ret_val,
>>                                                  l_pos_in_item,
>>                                                  1,
>>                                                  (struct
>>                                                   reiserfs_de_head
>>                                                   *)
>>                                                  body,
>>                                                  body
>>                                                  +
>>                                                  DEH_SIZE,
>>                                                  tb->
>>                                                  insert_size
>>                                                  [0]
>>                                   );
>>
>> Yes, that used to be 24 more columns to the right.  Gaak.
>
> Precisely. It's a clear show of the damage hard rules like that do.
> I can't even tell how the code should be fixed and if the simple merging
> would do, since I can't really imagine how it would look like :-)

I think you're missing the point, there is no simple fix for this sort
of formatting problem.  The 80 column hard limit didn't cause this
mangling, someone applying an obviously misguided quick fix to the
too-long line caused the problem.  The appropriate thing to do when
checkpatch tells you that a line is too long isn't necessarily to chop
the line into pieces.  The appropriate thing to do is look at the
surrounding context and determine what the underlying problem is.  In
this case Bart pointed out that quite a lot of the overly-complex
parameter could be reasonably moved to a helper macro, and the
too-long surrounding function should be broken up into manageable
pieces.

The fundamental disconnect here is that some people seem to think that
style guidelines like "no lines over 80 columns" are goals, they
aren't, they are just heuristics that have been found to point out bad
coding practices.

Note: I'm not specifically arguing for keeping the 80-column rule, the
project I work on uses 100 columns, and that's quite workable, but I
haven't had any problem working with 80 columns as a limit either.  I
do however think that just removing the limit without replacing it
with something better is a bad idea.

-Kevin Granade

> --
> Krzysztof Halasa
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

  reply	other threads:[~2009-12-18 14:52 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 21:57 Mikulas Patocka
2009-12-15 22:26 ` Bartlomiej Zolnierkiewicz
2009-12-17  9:31   ` Américo Wang
2009-12-17 15:14     ` Linus Torvalds
2009-12-17 15:18       ` Bartlomiej Zolnierkiewicz
2009-12-17 15:37         ` Linus Torvalds
2009-12-17 16:08           ` Bartlomiej Zolnierkiewicz
2009-12-17 16:21             ` Linus Torvalds
2009-12-17 16:30               ` Janakiram Sistla
2009-12-17 18:05               ` Andi Kleen
2009-12-18 13:31               ` Pádraig Brady
2009-12-18 16:32               ` Mikulas Patocka
2009-12-18 22:33                 ` Krzysztof Halasa
2009-12-18 13:04         ` Jiri Kosina
2009-12-18 13:55           ` Bartlomiej Zolnierkiewicz
2009-12-18 14:39             ` Krzysztof Halasa
2009-12-27 17:15             ` Jon Smirl
2009-12-21  6:32           ` Paul Mundt
2009-12-22 15:10             ` Jiri Kosina
2009-12-16 10:58 ` Andi Kleen
2009-12-16 19:59 ` Alex Chiang
2009-12-17  6:12 ` Paul Mundt
2009-12-17  8:34   ` Krzysztof Halasa
2009-12-17 23:29     ` Mikulas Patocka
2009-12-17 23:35       ` Al Viro
2009-12-18  4:29       ` Valdis.Kletnieks
2009-12-18  5:12         ` [PATCH] scripts/checkpatch.pl: Change long line warning to 105 chars Joe Perches
2009-12-18  5:57           ` Paul Mundt
2009-12-18 17:43             ` Linus Torvalds
2009-12-18 17:54               ` Joe Perches
2009-12-18 18:41               ` Andi Kleen
2009-12-18 14:37           ` Krzysztof Halasa
2009-12-18 15:12             ` [dm-devel] " Alasdair G Kergon
2009-12-18 16:58               ` Randy Dunlap
2009-12-18 17:12                 ` Mikulas Patocka
2009-12-18 22:36                   ` Krzysztof Halasa
2009-12-18 17:31             ` Joe Perches
2009-12-18 14:28         ` [PATCH] Drop 80-character limit in checkpatch.pl Krzysztof Halasa
2009-12-18 14:52           ` kevin granade [this message]
2009-12-18 16:43             ` Mikulas Patocka
2009-12-18 16:50               ` Linus Torvalds
2009-12-18 17:09                 ` Mikulas Patocka
2009-12-18 17:28                   ` Linus Torvalds
2009-12-18 21:15               ` kevin granade
2009-12-18 15:11           ` Bartlomiej Zolnierkiewicz
2009-12-17 22:37   ` Mikulas Patocka
2009-12-17 23:12     ` Paul Mundt
2009-12-17 23:33       ` Mikulas Patocka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7004b08e0912180652p42777da3h70906f2fbdb60a69@mail.gmail.com \
    --to=kevin.granade@gmail.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=khc@pm.waw.pl \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®