From nobody Thu Dec 05 22:33:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y48LF1pPrz5fnKT; Thu, 05 Dec 2024 22:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y48LF1Bl0z4fnH; Thu, 5 Dec 2024 22:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733438005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71v87HPiK9NxHEVuzIrikX2kg/znnCN5BwTaVjDHz/U=; b=lcFWT092+2MW5W4D87Q/PMMicS5eSBGpsQTqh7QCoTEOs44l3E5haLvASpBu3sdziX44qV CgrCoLfd1DIXDYg24LPWq2+QzJjPYsFSGAvlzvNl6+ktjW8As/sa+lOv7A+fZlAk8xraDU bEXP9x4oCoqjjojOC0q+CmR18ITbXoV+ln1LLCsJU7wdNWrymnhMv7JeSl0BDw5k0b8PUc yhhB5S3j9debTz4Qwtjht1Xghh4zIS7x6DfvXB2Aj5/21AbG70p6rDChJ07fVYboNQsbKs 0hgLTA0uZwzxbBev5yxqylRfhN9giZGaktD/0wJxf1sybU/B6pmYni3tTwZazw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733438005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71v87HPiK9NxHEVuzIrikX2kg/znnCN5BwTaVjDHz/U=; b=Ki8qoK6HyUicU/EJTFIfoxLcSkNUdWg3XSGjxI8dJoRGZliAHhqfK3kywgWAtACldtr5LT Xc8iscog2tJKgfOfCJFVFAcrM4pslnuec1dLolxvat7/KSg66qAFPXwUOPD4sZIk0r1f0C VH36ZKH02pMbPJYXwjVB1Ie7Adl+UwWN5FCC0FVqB2tzg4e/sNBoJlU4Cv4Hyg+iP6N6j/ RZd1pX+W2DAlLY8CZNGbs2WwvhgXg8k433JLpuFKFXcJN8IsxwyAtLBU2ykpe3Ec4NLp2/ CTsTjubRnbmr4+sp6eEm5IxYajjj82rnlBFn0OJNU7YtNQa5b9tR1toSGZn7pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733438005; a=rsa-sha256; cv=none; b=LFD5voH38WunfmlKkIMsCEhL48xknd3X9kquM2X9eXbhR1xY1GCZ0Q1hvotyPhjoB8a93P 2rXdGHnbPj6ACf0K5EqLzFopfISKh5quIHKqPnvWCqYUWZ049jNyVBhNJdTJtg+2bk6Xj7 nmnR3Oc/6xkf7nme/Jv7CfPaICvJyDBb+jd818DgjeuM2WNwM6iMVDzAgWXORxlrSGSeLJ p5ZIuo1hH6uoeOtLOXRNAuLlgIPm3DvnJr2fvCelyQE/BADTpvB4lFrgMJd00jtI/GoznJ uWBIYjRqP2bVXNTLmg+vdG6EgDj553tj++4V3ELy5Yh5xZCVseQ4F5N3Dzmdeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y48LF0T25z1BNW; Thu, 5 Dec 2024 22:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B5MXOZr004509; Thu, 5 Dec 2024 22:33:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B5MXOF4004506; Thu, 5 Dec 2024 22:33:24 GMT (envelope-from git) Date: Thu, 5 Dec 2024 22:33:24 GMT Message-Id: <202412052233.4B5MXOF4004506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0207010f595d - main - checkstyle9.pl: Better C++ filename matching List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0207010f595d5df070bfc092b9889d186355f649 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0207010f595d5df070bfc092b9889d186355f649 commit 0207010f595d5df070bfc092b9889d186355f649 Author: Warner Losh AuthorDate: 2024-12-05 22:27:08 +0000 Commit: Warner Losh CommitDate: 2024-12-05 22:33:49 +0000 checkstyle9.pl: Better C++ filename matching We have .cc, .hh, .cpp, and .hpp files in the tree. Update the regexp to match. Remove matching perl, python and non-preprocessed .s files from checking. Sponsored by: Netflix --- tools/build/checkstyle9.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index 24e33712ceda..50ff1e9bd680 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -12,7 +12,7 @@ use Term::ANSIColor qw(:constants); my $P = $0; $P =~ s@.*/@@g; -our $SrcFile = qr{\.(?:h|c|cpp|s|S|pl|py|sh)$}; +our $SrcFile = qr{\.(?:h|c|cpp|hpp|hh|cc|S|sh)$}; my $V = '0.31'; @@ -1439,7 +1439,7 @@ sub process { # Check for incorrect file permissions if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) { my $permhere = $here . "FILE: $realfile\n"; - if ($realfile =~ /(\bMakefile(?:\.objs)?|\.c|\.cc|\.cpp|\.h|\.mak|\.[sS])$/) { + if ($realfile =~ /(\bMakefile(?:\.objs)?|\.c|\.cc|\.cpp|\.h|\.hpp|\.mak|\.[sS])$/) { ERROR("do not set execute permissions for source files\n" . $permhere); } } @@ -1572,7 +1572,7 @@ sub process { } # check we are in a valid C source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c|cpp)$/); + next if ($realfile !~ /\.(h|hpp|c|cpp|cc|hh)$/); # Block comment styles @@ -1971,7 +1971,7 @@ sub process { { # Ignore 'catch (...)' in C++ - } elsif ($name =~ /^catch$/ && $realfile =~ /(\.cpp|\.h)$/) { + } elsif ($name =~ /^catch$/ && $realfile =~ /\.(cpp|h|hpp|hh|cc)$/) { # cpp #define statements have non-optional spaces, ie # if there is a space between the name and the open @@ -2068,7 +2068,7 @@ sub process { # Ignore : used in class declaration in C++ } elsif ($opv eq ':B' && $ctx =~ /Wx[WE]/ && - $line =~ /class/ && $realfile =~ /(\.cpp|\.h)$/) { + $line =~ /class/ && $realfile =~ /\.(cpp|h|hpp|hh|cc)$/) { # No spaces for: # -> @@ -2096,7 +2096,7 @@ sub process { } elsif ($op eq '!' || $op eq '~' || $opv eq '*U' || $opv eq '-U' || $opv eq '&U' || $opv eq '&&U') { - if ($op eq '~' && $ca =~ /::$/ && $realfile =~ /(\.cpp|\.h)$/) { + if ($op eq '~' && $ca =~ /::$/ && $realfile =~ /\.(cpp|h|hpp|cc|hh)$/) { # '~' used as a name of Destructor } elsif ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { @@ -2133,7 +2133,7 @@ sub process { } elsif ($ctx !~ /[EWC]x[CWE]/) { my $ok = 0; - if ($realfile =~ /\.cpp|\.h$/) { + if ($realfile =~ /\.(cpp|h|hpp|cc|hh)$/) { # Ignore template arguments <...> in C++ if (($op eq '<' || $op eq '>') && $line =~ /<.*>/) { $ok = 1;