File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2142,6 +2142,7 @@ sub process {
2142
2142
my $has_changelog = 0;
2143
2143
my $has_doc = 0;
2144
2144
my $has_test = 0;
2145
+ my $is_test = 0;
2145
2146
2146
2147
# Pre-scan the patch sanitizing the lines.
2147
2148
@@ -2828,6 +2829,8 @@ sub process {
2828
2829
# ignore C source files outside the source and test directories when checking patches
2829
2830
next if !$file and ($realfile !~ / ^(?:src|test|perf)\/ / || $realfile =~ / ^$skipSrcPaths / );
2830
2831
2832
+ $is_test = ($realfile =~ / ^(?:test|perf)\/ / );
2833
+
2831
2834
# line length limit (with some exclusions)
2832
2835
#
2833
2836
# There are a few types of lines that may extend beyond $max_line_length:
@@ -3579,7 +3582,7 @@ sub process {
3579
3582
}
3580
3583
3581
3584
# check for non-global char *foo[] = {"bar", ...} declarations.
3582
- if ($line =~ / ^.\s +(?:static\s +|const\s +)?char\s +\*\s *\w +\s *\[\s *\]\s *=\s *\{ / ) {
3585
+ if (! $is_test && $line =~ / ^.\s +(?:static\s +|const\s +)?char\s +\*\s *\w +\s *\[\s *\]\s *=\s *\{ / ) {
3583
3586
ERROR(" STATIC_CONST_CHAR_ARRAY" ,
3584
3587
" char * array declaration might be better as static const\n " . $herecurr );
3585
3588
}
@@ -4648,7 +4651,7 @@ sub process {
4648
4651
my $check_comment = 0;
4649
4652
my $check_comment_line = $linenr ;
4650
4653
my $check_comment_ident ;
4651
- if ($realfile =~ / ^(?:test|perf) \/ / ) {
4654
+ if ($is_test ) {
4652
4655
# ignore tests
4653
4656
} elsif ($realfile =~ / \b box\. h$ / && $line =~ / ^\+\s *(?:$Declare )?\s *box_set_/ ) {
4654
4657
# ignore box_set_XXX in box.h
You can’t perform that action at this time.
0 commit comments