public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Knut Omang <knut.omang@oracle.com>
To: Kees Cook <keescook@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Åsmund Østvold" <asmund.ostvold@oracle.com>,
	"Håkon Bugge" <haakon.bugge@oracle.com>,
	"John Haxby" <john.haxby@oracle.com>,
	linux-doc@vger.kernel.org,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Mickaël Salaün" <mic@digikod.net>,
	"Joe Perches" <joe@perches.com>
Subject: Re: [PATCH 0/7] Support for automatic checkpatch running in the kernel
Date: Fri, 17 Nov 2017 05:47:10 +0100	[thread overview]
Message-ID: <1510894030.3063.41.camel@oracle.com> (raw)
In-Reply-To: <CAGXu5j+j0TZ+QUMf09eifTwOwmgA=3AbA3e2PJQehKF61hMcRA@mail.gmail.com>

On Thu, 2017-11-16 at 14:57 -0800, Kees Cook wrote:
> On Thu, Nov 16, 2017 at 9:01 AM, Knut Omang <knut.omang@oracle.com> wrote:
> > 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.
> 
> Will these configurations be cascading? (For example, all of net/ uses
> a different comment style, so having that recorded in a single file
> would be nice.)

Good point, the net/ use case is certainly something I have been thinking about.
I didn't want to make it too complex in the first set, so I let patch 1-4
implement the basics with one file per directory and nothing across directories.

Patch 6 and 7 in this set extends this to "fallback", which (with the net/ case in mind)
should allow a single file under net/ to cover the whole subsystem for all subtrees that
don't have their own checkpatch.cfg, but will be overridden by files in subdirectories.

So from a documentation point of view this could be done with the set as it is,
with people just copying the "pervasive" and "line_len" commands from
a "global" net/checkpatch.cfg setup down into the subtrees as they start dealing with 
exceptions.

If we want something more automatic, it can certainly be extended, 
this would just require checkpatch to parse all the upwards checkpatch.cfg files for each
source file instead just taking the first found, which is what patch 6 implements.

Also the command language in the config files is rather limited, maybe other commands
maybe with more checkpatch additions would be useful to handle such scenarios..

Let me know what you think..

Thanks,
Knut

  reply	other threads:[~2017-11-17  4:47 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 [this message]
2017-11-17  9:08 ` Knut Omang

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=1510894030.3063.41.camel@oracle.com \
    --to=knut.omang@oracle.com \
    --cc=asmund.ostvold@oracle.com \
    --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 \
    /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