git: 1e8172457833 - main - checkstyle9: Remove irrelevant stuff from qemu
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 07 Jan 2024 16:51:54 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e817245783307fd30de71d9e3dc74df6ad20b05 commit 1e817245783307fd30de71d9e3dc74df6ad20b05 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2024-01-07 16:14:13 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-01-07 16:51:49 +0000 checkstyle9: Remove irrelevant stuff from qemu Remove some qemu project specific things we don't care about o Remove python interpreter check o Remove linux header check o Remove trace file specail treatment o Add $FreeBSD$ tag additions o Remove some experiemntal code we won't need o Remove commented out initializer code that we don't explicitly have a rule for. Sponsored by: Netflix --- tools/build/checkstyle9.pl | 64 ++-------------------------------------------- 1 file changed, 2 insertions(+), 62 deletions(-) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index aadf6ee152c5..d2c6ea77868d 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -170,8 +170,6 @@ if ($color =~ /^always$/i) { my $dbg_values = 0; my $dbg_possible = 0; -my $dbg_type = 0; -my $dbg_attr = 0; my $dbg_adv_dcs = 0; my $dbg_adv_checking = 0; my $dbg_adv_apw = 0; @@ -1436,17 +1434,12 @@ sub process { } } -# Only allow Python 3 interpreter - if ($realline == 1 && - $line =~ /^\+#!\ *\/usr\/bin\/(?:env )?python$/) { - ERROR("please use python3 interpreter\n" . $herecurr); - } - # Accept git diff extended headers as valid patches if ($line =~ /^(?:rename|copy) (?:from|to) [\w\/\.\-]+\s*$/) { $is_patch = 1; } +# Filter out bad email addresses. if ($line =~ /^(Author|From): .*noreply.*/) { ERROR("Real email adress is needed\n" . $herecurr); } @@ -1512,9 +1505,6 @@ 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"; @@ -1536,26 +1526,6 @@ sub process { $rpt_cleaners = 1; } -# checks for trace-events files - if ($realfile =~ /trace-events$/ && $line =~ /^\+/) { - if ($rawline =~ /%[-+ 0]*#/) { - ERROR("Don't use '#' flag of printf format ('%#') in " . - "trace-events, use '0x' prefix instead\n" . $herecurr); - } else { - my $hex = - qr/%[-+ *.0-9]*([hljztL]|ll|hh)?(x|X|"\s*PRI[xX][^"]*"?)/; - - # don't consider groups splitted by [.:/ ], like 2A.20:12ab - my $tmpline = $rawline; - $tmpline =~ s/($hex[.:\/ ])+$hex//g; - - if ($tmpline =~ /(?<!0x)$hex/) { - ERROR("Hex numbers must be prefixed with '0x'\n" . - $herecurr); - } - } - } - # check we are in a valid source file if not then ignore this hunk next if ($realfile !~ /$SrcFile/); @@ -1584,7 +1554,7 @@ sub process { } # check for RCS/CVS revision markers - if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|\b)/) { + if ($rawline =~ /^\+.*\$(FreeBSD|Revision|Log|Id)(?:\$|\b)/) { ERROR("CVS style keyword markers, these will _not_ be updated\n". $herecurr); } @@ -1886,25 +1856,6 @@ sub process { #ignore lines not being added if ($line=~/^[^\+]/) {next;} -# TEST: allow direct testing of the type matcher. - if ($dbg_type) { - if ($line =~ /^.\s*$Declare\s*$/) { - ERROR("TEST: is type\n" . $herecurr); - } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) { - ERROR("TEST: is not type ($1 is)\n". $herecurr); - } - next; - } -# TEST: allow direct testing of the attribute matcher. - if ($dbg_attr) { - if ($line =~ /^.\s*$Modifier\s*$/) { - ERROR("TEST: is attr\n" . $herecurr); - } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { - ERROR("TEST: is not attr ($1 is)\n". $herecurr); - } - next; - } - # check for initialisation to aggregates open brace on the next line if ($line =~ /^.\s*\{/ && $prevline =~ /(?:^|[^=])=\s*$/) { @@ -1928,17 +1879,6 @@ sub process { $line =~ s@//.*@@; $opline =~ s@//.*@@; -# check for global initialisers. -# if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) { -# ERROR("do not initialise globals to 0 or NULL\n" . -# $herecurr); -# } -# check for static initialisers. -# if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) { -# ERROR("do not initialise statics to 0 or NULL\n" . -# $herecurr); -# } - # * goes on variable not on type # (char*[ const]) if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) {