* checkpatch post-commit hook
@ 2017-03-04 0:13 Alison Schofield
2017-03-04 1:15 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Alison Schofield @ 2017-03-04 0:13 UTC (permalink / raw)
To: outreachy-kernel, joe
I'm thinking of adding a git post-commit hook to our First Patch Tutorial.
Recently, Joe Perches (checkpatch author) showed us a spelling error
in a log message found by checkpatch and it made me realize we may be
under-utilizing checkpatch in the workflow as defined in the first patch
tutorial.
If you use it pre-commit (and while working a file) it shows you
issues in your files. But, if you use it on the built patch, you
can also see WARNINGS like:
WARNING: Do not use whitespace before Signed-off-by:
WARNING: please write a paragraph that describes the config symbol fully
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
Here's a post commit hook:
.git/hooks$ cat post-commit
#!/bin/sh
exec git show HEAD | scripts/checkpatch.pl --nosummary
If someone will verify this and agree we should add it - I'll add it to
the first patch tutorial.
And, of course, you'll let me know if there's another/better way
to do it!
alisons
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checkpatch post-commit hook
2017-03-04 0:13 checkpatch post-commit hook Alison Schofield
@ 2017-03-04 1:15 ` Joe Perches
2017-03-04 22:21 ` Alison Schofield
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2017-03-04 1:15 UTC (permalink / raw)
To: Alison Schofield, outreachy-kernel
On Fri, 2017-03-03 at 16:13 -0800, Alison Schofield wrote:
> I'm thinking of adding a git post-commit hook to our First Patch Tutorial.
>
> Recently, Joe Perches (checkpatch author) showed us a spelling error
> in a log message found by checkpatch and it made me realize we may be
> under-utilizing checkpatch in the workflow as defined in the first patch
> tutorial.
>
> If you use it pre-commit (and while working a file) it shows you
> issues in your files. But, if you use it on the built patch, you
> can also see WARNINGS like:
>
> WARNING: Do not use whitespace before Signed-off-by:
> WARNING: please write a paragraph that describes the config symbol fully
> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
>
> Here's a post commit hook:
>
> .git/hooks$ cat post-commit
> #!/bin/sh
> exec git show HEAD | scripts/checkpatch.pl --nosummary
exec git show --format=email HEAD | ./scripts/checkpatch.pl --strict
> If someone will verify this and agree we should add it - I'll add it to
> the first patch tutorial.
>
> And, of course, you'll let me know if there's another/better way
> to do it!
>
> alisons
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checkpatch post-commit hook
2017-03-04 1:15 ` Joe Perches
@ 2017-03-04 22:21 ` Alison Schofield
0 siblings, 0 replies; 3+ messages in thread
From: Alison Schofield @ 2017-03-04 22:21 UTC (permalink / raw)
To: Joe Perches, outreachy-kernel
On Fri, Mar 03, 2017 at 05:15:46PM -0800, Joe Perches wrote:
> On Fri, 2017-03-03 at 16:13 -0800, Alison Schofield wrote:
> > I'm thinking of adding a git post-commit hook to our First Patch Tutorial.
> >
> > Recently, Joe Perches (checkpatch author) showed us a spelling error
> > in a log message found by checkpatch and it made me realize we may be
> > under-utilizing checkpatch in the workflow as defined in the first patch
> > tutorial.
> >
> > If you use it pre-commit (and while working a file) it shows you
> > issues in your files. But, if you use it on the built patch, you
> > can also see WARNINGS like:
> >
> > WARNING: Do not use whitespace before Signed-off-by:
> > WARNING: please write a paragraph that describes the config symbol fully
> > WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
> >
> > Here's a post commit hook:
> >
> > .git/hooks$ cat post-commit
> > #!/bin/sh
> > exec git show HEAD | scripts/checkpatch.pl --nosummary
>
> exec git show --format=email HEAD | ./scripts/checkpatch.pl --strict
Thanks Joe. Added the codespell option too.
exec git show --format=email HEAD | ./scripts/checkpatch.pl --strict --codespell
codespell option uses this dictionary: /usr/share/codespell/dictionary.txt
get it like this: apt-get install codespell
alisons
>
>
> > If someone will verify this and agree we should add it - I'll add it to
> > the first patch tutorial.
> >
> > And, of course, you'll let me know if there's another/better way
> > to do it!
> >
> > alisons
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-04 22:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-04 0:13 checkpatch post-commit hook Alison Schofield
2017-03-04 1:15 ` Joe Perches
2017-03-04 22:21 ` Alison Schofield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.