linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* git pre-commit hook running checkpatch.pl
@ 2010-01-20  2:02 Ben Dooks
  2010-01-20 10:00 ` Russell King - ARM Linux
  2010-01-20 10:01 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Dooks @ 2010-01-20  2:02 UTC (permalink / raw)
  To: linux-arm-kernel

I've written a git pre-commit[1] hook which stops any commits happening if
checkpatch.pl reports problems with the patch. Any comments?

[1] http://www.fluff.org/ben/linux/githooks/pre-commit

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100120/e12ebdf8/attachment.sig>

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

* git pre-commit hook running checkpatch.pl
  2010-01-20  2:02 git pre-commit hook running checkpatch.pl Ben Dooks
@ 2010-01-20 10:00 ` Russell King - ARM Linux
  2010-01-20 10:01 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2010-01-20 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 20, 2010 at 02:02:02AM +0000, Ben Dooks wrote:
> I've written a git pre-commit[1] hook which stops any commits happening if
> checkpatch.pl reports problems with the patch. Any comments?

Very bad - checkpatch can be wrong at times.

Eg 1, asm/irq.h vs linux/irq.h
Eg 2, asm/memory.h vs linux/memory.h
Eg 3, lines longer than 80 characters for printk() strings are preferred
  so that they are grep-able.

checkpatch is at best a guide, not a set of hard rules.

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

* git pre-commit hook running checkpatch.pl
  2010-01-20  2:02 git pre-commit hook running checkpatch.pl Ben Dooks
  2010-01-20 10:00 ` Russell King - ARM Linux
@ 2010-01-20 10:01 ` Mark Brown
  2010-01-20 15:30   ` Uwe Kleine-König
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-01-20 10:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 20, 2010 at 02:02:02AM +0000, Ben Dooks wrote:

> I've written a git pre-commit[1] hook which stops any commits happening if
> checkpatch.pl reports problems with the patch. Any comments?

> [1] http://www.fluff.org/ben/linux/githooks/pre-commit

Checkpatch does sometimes generate the occasional false positive which
can be annoying when they trigger.  It can also be a problem when doing
bugfixes IME - if an existing file has lots of checkpatch issues then a
fix which maintains the same coding style as the surrounding code can
trigger checkpatch issues which would if fixed make the code not fit in
with the rest of the file.  Obviously it'd be desirable to fix the file
but that's a bit unreasonable for people submitting bug fixes,
especially when pushing fixes to Linus and stable.

That said, monitoring for checkpatch issues is useful.

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

* git pre-commit hook running checkpatch.pl
  2010-01-20 10:01 ` Mark Brown
@ 2010-01-20 15:30   ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2010-01-20 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 20, 2010 at 10:01:55AM +0000, Mark Brown wrote:
> On Wed, Jan 20, 2010 at 02:02:02AM +0000, Ben Dooks wrote:
> 
> > I've written a git pre-commit[1] hook which stops any commits happening if
> > checkpatch.pl reports problems with the patch. Any comments?
> 
> > [1] http://www.fluff.org/ben/linux/githooks/pre-commit
> 
> Checkpatch does sometimes generate the occasional false positive which
> can be annoying when they trigger.  It can also be a problem when doing
> bugfixes IME - if an existing file has lots of checkpatch issues then a
> fix which maintains the same coding style as the surrounding code can
> trigger checkpatch issues which would if fixed make the code not fit in
> with the rest of the file.  Obviously it'd be desirable to fix the file
> but that's a bit unreasonable for people submitting bug fixes,
> especially when pushing fixes to Linus and stable.
> 
> That said, monitoring for checkpatch issues is useful.
Maybe only print the warnings instead of stopping a commit?  I'd not
like me stopping here not only for the reasons pointed out by Mark and
Russell, but also as I frequently do wip-commits that not necessarily
are checkpatch-clean.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

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

end of thread, other threads:[~2010-01-20 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20  2:02 git pre-commit hook running checkpatch.pl Ben Dooks
2010-01-20 10:00 ` Russell King - ARM Linux
2010-01-20 10:01 ` Mark Brown
2010-01-20 15:30   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).