Skip to content

Commit beb7806

Browse files
committed
Allow updating .result files
Follows up #23 Fixes #35
1 parent 8cf949f commit beb7806

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: checkpatch.pl

+8-2
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,7 @@ sub process {
21412141
my %commit_log_tags = ();
21422142
my $has_changelog = 0;
21432143
my $warned_about_test_result_file = 0;
2144+
my $new_result_file = 0;
21442145
my $has_doc = 0;
21452146
my $has_test = 0;
21462147
my $is_test = 0;
@@ -2303,6 +2304,11 @@ sub process {
23032304
$in_commit_log = 0;
23042305
next
23052306
}
2307+
2308+
if ($line =~ /^new (file )?mode 100644/) {
2309+
$new_result_file = 1;
2310+
}
2311+
23062312
if ($line =~ /^new (file )?mode 0?120/ ||
23072313
$line =~ /^index [0-9a-f]+..[0-9a-f]+ 0?120/) {
23082314
$is_symlink = 1;
@@ -2826,10 +2832,10 @@ sub process {
28262832

28272833
if (!$warned_about_test_result_file &&
28282834
$realfile =~ /^test\/.*\.result$/ &&
2829-
$line =~ /^\+/) {
2835+
$new_result_file) {
28302836
$warned_about_test_result_file = 1;
28312837
ERROR("TEST_RESULT_FILE",
2832-
"Please avoid tests with .result files\n");
2838+
"Please avoid new tests with .result files\n");
28332839
}
28342840

28352841
# check we are in a valid C source file if not then ignore this hunk

0 commit comments

Comments
 (0)