From: Knut Omang <knut.omang@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: "Åsmund Østvold" <asmund.ostvold@oracle.com>,
"Håkon Bugge" <haakon.bugge@oracle.com>,
"John Haxby" <john.haxby@oracle.com>,
"Kees Cook" <keescook@chromium.org>,
linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Mickaël Salaün" <mic@digikod.net>,
"Joe Perches" <joe@perches.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Masahiro Yamada" <yamada.masahiro@socionext.com>,
"Andy Whitcroft" <apw@canonical.com>
Subject: Re: [PATCH 0/7] Support for automatic checkpatch running in the kernel
Date: Fri, 17 Nov 2017 10:08:44 +0100 [thread overview]
Message-ID: <1510909724.3063.55.camel@oracle.com> (raw)
In-Reply-To: <cover.3dd1d0c1f15a7a7c418f20ebafc9719afc1c2704.1510840787.git-series.knut.omang@oracle.com>
I realize the Cc: list for the cover letter probably should have included all
the relevant maintainers for this set, sorry about that!
For convenience I also put up a more reader friendly copy of the doc after patch 7 here:
http://heim.ifi.uio.no/~knuto/kernel/4.14/dev-tools/run-checkpatch.html
Thanks,
Knut
On Thu, 2017-11-16 at 18:01 +0100, Knut Omang wrote:
> This patch series implements features to facilitate running checkpatch on the
> entire kernel as part of automatic testing.
>
> This is done by by adding a few small features to checkpatch and put these
> features to use to implement support for a new Makefile environment variable
> P={1,2} following the pattern of sparse and the C={1,2} variable. The basic
> functionality + docs are in patch #1-4.
>
> It also fixes a minor issue with "checkpatch --fix-inplace" found during testing
> (patch #5).
>
> The most important checkpatch feature added is the --ignore-cfg feature, which
> takes a file argument and parses that file according to this minimal language:
>
> # comments
> line_len <n>
> except checkpatch_type [files ...]
> pervasive checkpatch_type1 [checkpatch_type2 ...]
>
> With "make P=2" checkpatch is called with "--file" and "--ignore_cfg
> checkpatch.cfg" which causes it to look for a file named 'checkpatch.cfg' in the
> same directory as the source file. If that file exists, checkpatch will be run
> with an implicit --strict and with the @ignore list expanded with content from
> the configuration file. If it does not exist, make will simply silently ignore
> the file.
>
> Patches #6-7 enhances this behaviour to also scan the directories above a file
> until a match for the --file parameter is found.
>
> The idea is that the community can work to add checkpatch.cfg files to
> directories, serving both as documentation and as a way for subsystem
> maintainers to enforce policies and individual tastes as well as TODOs and/or
> priorities, to make it easier for newcomers to contribute in this area. By
> ignoring directories without such files, automation can start right away as it
> is trivially possible to run errorless with P=2 for the entire kernel.
>
> The patches includes a documentation file with some more details.
>
> This patch set has evolved from an earlier implementation I made that was just a
> wrapper script around checkpatch. That version have been used for a number of
> years on a driver project I worked on where we had automatic checkin regression
> testing. I extended that to also run checkpatch to avoid having to clean up
> frequent unintended whitespace changes and style violations from others...
>
> I have also tested this version on some directories I am familiar with. The
> result of that work is available in two patch sets of 10 and 11 patches, but we
> agreed that it would be better to post them as separate patch sets later.
>
> Those patch sets illustrates how I picture the "flow" from just "reining in" the
> checkpatch detections to actually fixing classes of checkpatch issues one by
> one, while updating the checkpatch.cfg file(s) to have 0 errors or warnings at
> any commit boundary.
>
> The combined set is available here:
>
> git://github.com/knuto/linux.git branch checkpatch
>
> Comments and suggestions appreciated!
>
> Thanks,
> Knut
>
> Knut Omang (7):
> checkpatch: Implement new --ignore-cfg parameter
> kbuild: Add P= command line flag to run checkpatch
> checkpatch: Add a few convenience options to disable/modify features
> Documentation: Add documentation for the new P= Makefile option
> checkpatch: Improve --fix-inplace for TABSTOP
> checkpatch: Make --ignore-cfg look recursively for the file
> Documentation: Update checkpatch --ignore-cfg description
>
> Documentation/dev-tools/index.rst | 1 +-
> Documentation/dev-tools/run-checkpatch.rst | 109 ++++++++++++++++++++++-
> Makefile | 20 +++-
> scripts/Makefile.build | 13 +++-
> scripts/checkpatch.pl | 108 +++++++++++++++++++++-
> 5 files changed, 249 insertions(+), 2 deletions(-)
> create mode 100644 Documentation/dev-tools/run-checkpatch.rst
>
> base-commit: bebc6082da0a9f5d47a1ea2edc099bf671058bd4
prev parent reply other threads:[~2017-11-17 9:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 17:01 [PATCH 0/7] Support for automatic checkpatch running in the kernel Knut Omang
2017-11-16 17:01 ` [PATCH 1/7] checkpatch: Implement new --ignore-cfg parameter Knut Omang
2017-11-16 17:09 ` Joe Perches
2017-11-16 17:43 ` Knut Omang
2017-11-16 17:01 ` [PATCH 2/7] kbuild: Add P= command line flag to run checkpatch Knut Omang
2017-11-20 16:18 ` Masahiro Yamada
2017-11-20 19:48 ` Jim Davis
2017-11-20 20:08 ` Luc Van Oostenryck
2017-11-20 21:10 ` Knut Omang
2017-11-20 21:22 ` Luc Van Oostenryck
2017-11-21 0:00 ` Jim Davis
2017-11-21 8:10 ` Knut Omang
2017-11-21 19:48 ` Jim Davis
2017-11-21 20:03 ` Joe Perches
2017-11-20 21:04 ` Knut Omang
2017-11-16 17:01 ` [PATCH 3/7] checkpatch: Add a few convenience options to disable/modify features Knut Omang
2017-11-16 17:01 ` [PATCH 4/7] Documentation: Add documentation for the new P= Makefile option Knut Omang
2017-11-16 17:01 ` [PATCH 5/7] checkpatch: Improve --fix-inplace for TABSTOP Knut Omang
2017-11-16 17:01 ` [PATCH 6/7] checkpatch: Make --ignore-cfg look recursively for the file Knut Omang
2017-11-16 17:01 ` [PATCH 7/7] Documentation: Update checkpatch --ignore-cfg description Knut Omang
2017-11-16 22:57 ` [PATCH 0/7] Support for automatic checkpatch running in the kernel Kees Cook
2017-11-17 4:47 ` Knut Omang
2017-11-17 9:08 ` Knut Omang [this message]
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=1510909724.3063.55.camel@oracle.com \
--to=knut.omang@oracle.com \
--cc=apw@canonical.com \
--cc=asmund.ostvold@oracle.com \
--cc=corbet@lwn.net \
--cc=haakon.bugge@oracle.com \
--cc=joe@perches.com \
--cc=john.haxby@oracle.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mic@digikod.net \
--cc=yamada.masahiro@socionext.com \
/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 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.