Received: by 10.223.164.202 with SMTP id h10csp769026wrb; Fri, 17 Nov 2017 08:20:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMaGXZFy8ROFSA9ir2cRheqcPMxwdKfIcLNwYMSZ/kw5VTKi5TWWGK6RXG42GWw1Hlc7Hosj X-Received: by 10.98.162.26 with SMTP id m26mr2653349pff.0.1510935600004; Fri, 17 Nov 2017 08:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510935599; cv=none; d=google.com; s=arc-20160816; b=m6hcbpv2ZxpmQ4rrw2zVjnE4m0/IElWKBwrQ9BdK/RWyjl1tZkHSwJt0QuNsj6bDJF KmtWIrt+zf+F9lh/jCrSNQyHbY1W2h30tZHD1q4U04vg6nikzJQB04j7cPrBw5JAnfUG Lrkxy6NKz4NtZOtkYppN8qMsOT/Tfmz2ksS7tCpl2+ymRO0hc/dcPtQHsbZHyJRGxjAI XeD48UZY2tHWwANspzpPGOIuMUYSpzLdfEYu+6Szyd5Gg06IrZkEjuqWwLV0G8qXtSu3 Iw3e7DRzf0YUgwGM6VBEitbYeyRNBXdgJnsDYqfu12luf443/s6T6rZMgRxqp4tf7/OK VD3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=BMEgiqMMSvcD2g+eYhY0mizVmAqHCdaA3CVfB9zCywI=; b=SI2f2qjEjIond20ljHSCrFYgU/l9f4/+2gLTvAQlF3aK1O4lAvXiNvfDmiOFUDryoq /al2z0WzSRSe1B6FO+ZbVqeM0xve5kIl+j1E36GFZADCVnrBCNWJb1QOUUIK8wQi1VyU 1f7EvK6I0MYDsxUFbE0pFqGrP4UDJ9iEOW7ZjOh/aKshy+nVsxn/p14A0MDM2JKbgF8G 24fOmn9WGqdAt/BaPfW23HXO1+hGutJdNaDuLYS/gqj4TRmWXdegIlKUuyT92sEIyf/Z 2Cg5eOKPd/6Erwozu8OmoTlrgN7H6W8AI4wvZkhdrOsVKIaTXR0jGY0JaGVhYVg+kyu7 S+Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si3000884pgn.138.2017.11.17.08.19.46; Fri, 17 Nov 2017 08:19:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965030AbdKQJJ1 convert rfc822-to-8bit (ORCPT + 91 others); Fri, 17 Nov 2017 04:09:27 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:29189 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933916AbdKQJJO (ORCPT ); Fri, 17 Nov 2017 04:09:14 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAH98x8j019407 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Nov 2017 09:09:00 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vAH98xRm018241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Nov 2017 09:08:59 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAH98vEp019664; Fri, 17 Nov 2017 09:08:57 GMT Received: from asu (/10.175.209.58) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 Nov 2017 01:08:55 -0800 Message-ID: <1510909724.3063.55.camel@oracle.com> Subject: Re: [PATCH 0/7] Support for automatic checkpatch running in the kernel From: Knut Omang To: linux-kernel@vger.kernel.org Cc: =?ISO-8859-1?Q?=C5smund_=D8stvold?= , =?ISO-8859-1?Q?H=E5kon?= Bugge , John Haxby , Kees Cook , linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, Mauro Carvalho Chehab , =?ISO-8859-1?Q?Micka=EBl_Sala=FCn?= , Joe Perches , Jonathan Corbet , Masahiro Yamada , Andy Whitcroft Date: Fri, 17 Nov 2017 10:08:44 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-2.fc25) Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >        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 From 1584318270736272170@xxx Fri Nov 17 13:00:43 +0000 2017 X-GM-THRID: 1584245555255033826 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread