Skip to content

Commit

Permalink
Detect adding new .result files
Browse files Browse the repository at this point in the history
Part of #23
  • Loading branch information
ligurio committed Sep 2, 2022
1 parent fbd3f84 commit 9921d23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,7 @@ sub process {

my %commit_log_tags = ();
my $has_changelog = 0;
my $has_diff_file = 0;
my $has_doc = 0;
my $has_test = 0;
my $is_test = 0;
Expand Down Expand Up @@ -2731,6 +2732,9 @@ sub process {
if ($realfile =~ /^(?:static-build\/)?test\/.*\//) {
$has_test = 1;
}
if ($realfile =~ /\.result$/) {
$has_diff_file = 1;
}

# check for repeated words separated by a single space
# avoid false positive from list command eg, '-rw-r--r-- 1 root root'
Expand Down Expand Up @@ -5158,6 +5162,10 @@ sub process {
ERROR("NO_TEST",
"Please add test or NO_TEST=<reason> tag\n");
}
if ($has_test && $has_diff_file) {
ERROR("DIFF_FILE",
"Please avoid tests with .result files\n");
}
}

print report_dump();
Expand Down

0 comments on commit 9921d23

Please sign in to comment.