scripts/checkpatch.pl: process .c.inc and .h.inc files as C source
authorMatheus Ferst <matheus.ferst@eldorado.org.br>
Thu, 20 May 2021 19:51:42 +0000 (16:51 -0300)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 7 Jun 2021 13:49:30 +0000 (14:49 +0100)
Change the regex used to determine whether a file should be processed as
C source to include .c.inc and .h.inc extensions.

Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Message-Id: <20210520195142.941261-1-matheus.ferst@eldorado.org.br>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
scripts/checkpatch.pl

index 3d185cceac94790e667c6c6eb77a57925fb877d6..bbcd25ae05775b17d1521ed9222a495b447a102e 100755 (executable)
@@ -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)(\.inc)?|cpp|s|S|pl|py|sh)$};
 
 my $V = '0.31';
 
@@ -1671,7 +1671,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|c)(\.inc)?|cpp)$/);
 
 # Block comment styles