Received: by 10.223.164.202 with SMTP id h10csp2326599wrb; Thu, 16 Nov 2017 13:14:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMYQQ/jZoThkKnRtgys+EzqXCvBsrR2kiUKC6xzicne3Pc9/H7iWtjlC9/KbfWVLZr4D8n5d X-Received: by 10.99.47.134 with SMTP id v128mr3006980pgv.232.1510866893584; Thu, 16 Nov 2017 13:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510866893; cv=none; d=google.com; s=arc-20160816; b=FqYDCGxpCSRhbEcp9ItD1d92frY0NYr+XJjqQ+gdeEQxA5YqWQKIpvWtlrPUi+IfEI H3Bl1dx75/cRvsDJl5Klw9LO1Bg2Wh36cY5hA3MP2tJHEI+bJqhOCfXsEKrpKpaG7/2a LH4vQCRSzkJS1816fOwX2chgQVkWCWcS7bidNTf1Ft9u6UQAQNxjCtsmefXPUSHrSdSF XWuGS6pw3guL7nZoopDLrcOnOHVg3o5wVJB3hdfrvwyM3BvmplIMkF2VFoS69RiZZCUj QyNWEvcsazLkcLvy6+8kzdJ5gN9WDrcGSMS8GYe8ytZWIL/5+CC8P34aoHh5yuw46B0m IKYg== 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:references :in-reply-to:mime-version:message-id:date:subject:cc:to:from :arc-authentication-results; bh=16u/kJ48tczrD2PyDs1HfkelhtP9dyR7KQzEsOa7D6c=; b=098m1gAwMgJri3OE6FQFLfNh2FidXy+WCQ1x3ejF2orSXLfOcIRCMAPzU/wnNVOg5X ie4cd5loa1gYMYcywIg+d2YqwvcUE0dC+u7fe0EmmN4fJxPRm7DIPFYPIIUlvgmNwXZb UmNa+Wopwb9g9ZKtb0m/HbNNV2ZOAmI8V8l+gbDPLbAIhjtyt1HSR7jhFoqfi0NGIb6I PcyU8+aw4wcTs4FdXu0+jX4dKzacQT724fn8dMTkL5i0az3/sy5nRZf7R4V4Rh1zeGhs jbuzGiQ31dc2p5RFcgEDNltfeOh+XL9IOXlqdmp9lRvzUWYEjoUGcea3n46Isa16z3g7 +HuA== 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 w21si1647844pfa.3.2017.11.16.13.14.40; Thu, 16 Nov 2017 13:14:53 -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 S936186AbdKPRCl (ORCPT + 92 others); Thu, 16 Nov 2017 12:02:41 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:50844 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936114AbdKPRCa (ORCPT ); Thu, 16 Nov 2017 12:02:30 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAGH2Q1F000682 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 17:02:26 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAGH2Pih007615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 17:02:26 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAGH2P3w027447; Thu, 16 Nov 2017 17:02:25 GMT Received: from abi.no.oracle.com (/10.172.144.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Nov 2017 09:02:25 -0800 From: Knut Omang To: linux-kernel@vger.kernel.org Cc: Knut Omang , Andy Whitcroft , Joe Perches Subject: [PATCH 3/7] checkpatch: Add a few convenience options to disable/modify features Date: Thu, 16 Nov 2017 18:01:43 +0100 Message-Id: <32aca91e06a12fcc2861184f36c1625227938b77.1510840787.git-series.knut.omang@oracle.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These are options that are useful when running from make, to allow flags already supplied by make to be overridden (later on the command line) Add these two options to cancel the effects of --quiet and --ignore-cfg: --no-quiet --no-ignore-cfg Also added: --req-ignore-cfg: With --ignore-cfg - treat a nonexistent file as if it were an empty file, effectively enforcing a full checkpatch --strict run. The default behaviour with --ignore-cfg is not to perform any checkpatch checking if an ignore configuration file is not found. This was done to enable automated checkpatch runs for directories that are "clean" according to the configuration. Signed-off-by: Knut Omang Acked-by: Håkon Bugge Acked-by: Åsmund Østvold --- scripts/checkpatch.pl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 834a1d8..387292f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -20,6 +20,7 @@ my $V = '0.32'; use Getopt::Long qw(:config no_auto_abbrev); my $quiet = 0; +my $no_quiet; my $tree = 1; my $chk_signoff = 1; my $chk_patch = 1; @@ -49,6 +50,9 @@ my @ignore = (); my $help = 0; my $configuration_file = ".checkpatch.conf"; my $ignore_cfg_file; +my $no_ignore_cfg_file; +my $req_ignore_cfg_file; +my $not_defined; my $max_line_length = 80; my $ignore_perl_version = 0; my $minimum_perl_version = 5.10.0; @@ -70,6 +74,7 @@ Version: $V Options: -q, --quiet quiet + --no-quiet Undo the effect of a previous --quiet argument --no-tree run without a kernel tree --no-signoff do not check for 'Signed-off-by' line --patch treat FILE as patchfile (default) @@ -94,6 +99,10 @@ Options: --ignore-cfg FILE parse this file for a detailed file specific ignore list, silently exit without checking if an ignore config file is not found. + --req-ignore-cfg With --ignore-cfg - if the file is not found, behave as + if the file existed and was empty, which is identical + to a normal run with --strict + --no-ignore-cfg undo the effect of any previous --ignore-cfg argument --show-types show the specific message type in the output --max-line-length=n set the maximum line length, if exceeded, warn --min-conf-desc-length=n set the min description length, if shorter, warn @@ -104,6 +113,8 @@ Options: --debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of 'values', 'possible', 'type', and 'attr' (default is all off) + --no-errors Let checkpatch return status 0 even in presence + of errors. --test-only=WORD report only warnings/errors containing WORD literally --fix EXPERIMENTAL - may create horrible results @@ -198,6 +209,7 @@ foreach (@ARGV) { GetOptions( 'q|quiet+' => \$quiet, + 'no-quiet' => \$no_quiet, 'tree!' => \$tree, 'signoff!' => \$chk_signoff, 'patch!' => \$chk_patch, @@ -206,6 +218,8 @@ GetOptions( 'showfile!' => \$showfile, 'f|file!' => \$file, 'ignore-cfg=s' => \$ignore_cfg_file, + 'no-ignore-cfg!' => \$no_ignore_cfg_file, + 'req-ignore-cfg!' => \$req_ignore_cfg_file, 'g|git!' => \$git, 'subjective!' => \$check, 'strict!' => \$check, @@ -238,6 +252,9 @@ help(0) if ($help); list_types(0) if ($list_types); +$quiet = 0 if defined($no_quiet); +$ignore_cfg_file = $not_defined if defined($no_ignore_cfg_file); + # Enforce --strict if used with a ignore configuration file: $check = 1 if defined($ignore_cfg_file); @@ -299,7 +316,7 @@ sub hash_show_words { } } -parse_ignore_cfg_file(@ARGV) || exit(0); +parse_ignore_cfg_file(@ARGV) || defined($req_ignore_cfg_file) || exit(0); hash_save_array_words(\%ignore_type, \@ignore); hash_save_array_words(\%use_type, \@use); -- git-series 0.9.1 From 1584268763647450613@xxx Thu Nov 16 23:53:50 +0000 2017 X-GM-THRID: 1584246305436409990 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread