Received: from eggs.gnu.org ([2001:4830:134:3::10]:48423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXNzw-0004LM-8a for qemu-devel@nongnu.org; Wed, 10 Aug 2016 03:32:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXNzs-00005j-09 for qemu-devel@nongnu.org; Wed, 10 Aug 2016 03:32:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56578 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXNzr-00005f-Qt for qemu-devel@nongnu.org; Wed, 10 Aug 2016 03:32:15 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7A7TJGd079418 for ; Wed, 10 Aug 2016 03:32:15 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 24qm9q8a07-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 10 Aug 2016 03:32:15 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Aug 2016 08:32:13 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 16DFA1B0804B for ; Wed, 10 Aug 2016 08:33:45 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7A7WBn624379536 for ; Wed, 10 Aug 2016 07:32:11 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7A7WB4j022997 for ; Wed, 10 Aug 2016 01:32:11 -0600 Date: Wed, 10 Aug 2016 09:32:10 +0200 From: Cornelia Huck In-Reply-To: <878tw55dg0.fsf@dusky.pond.sub.org> References: <1470757664-25161-1-git-send-email-pbonzini@redhat.com> <1470757664-25161-2-git-send-email-pbonzini@redhat.com> <878tw55dg0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160810093210.7ec28256.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/3] checkpatch: tweak the files in which TABs are checked List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Paolo Bonzini , thuth@redhat.com, famz@redhat.com, qemu-devel@nongnu.org On Wed, 10 Aug 2016 08:46:07 +0200 Markus Armbruster wrote: > I'm afraid "if not then tabs are allowed" is confusing. We're obviously > skipping more than just the tabs check: RCS/CVS revision markers, and a > whole bunch of C style checks. Makes sense, we don't want to do these > checks for imported files. "if not then tabs are allowed" starts to > make some sense only once you've stared at the next "next if ..." line > for a while. Let's avoid that. Minimal change: > > # check we are in a valid source file; if not then ignore this hunk > # make an exception from some scripts imported from other projects. > > Radim's "[PATCH] checkpatch: ignore automatically imported Linux > headers" adds a similar exception for other imported files in a > different place: > > @@ -1312,6 +1312,9 @@ sub process { > # ignore non-hunk lines and lines being removed > next if (!$hunk_line || $line =~ /^-/); > > +# ignore files that are being periodically imported from Linux > + next if ($realfile =~ /^(linux-headers|include\/standard-headers)\//); > + > #trailing whitespace > if ($line =~ /^\+.*\015/) { > my $herevet = "$here\n" . cat_vet($rawline) . "\n"; > > Should both exceptions be in the same place? There are two cases of 'imported file': (a) Things like the headers update where we want to copy whatever we got from the kernel: If coding style is already messed up there, we still want to copy. (b) Things like checkpatch.pl which we tweak ourselves: We want to keep close to the existing coding style, but don't want to mess up things further. I think in the long run it would make sense to skip any checks for case (a) but still keep a subset of checks (like trailing whitespace) for (b). For the sake of silencing the checkpatch bot, just skipping (a) and (b) makes sense for now.