Skip to content

Commit 12c13a0

Browse files
committed
Check that patch has dependencies update
To disable the new checks, one can add NO_DEPS tag to the commit message.
1 parent c5a5294 commit 12c13a0

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

checkpatch.pl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ sub hash_show_words {
498498
NO_DOC|
499499
NO_TEST|
500500
NO_CHANGELOG
501+
NO_DEPS
501502
)};
502503

503504
our $github_ref = qr{(https?:\/\/)?(www\.)?github\.com\b([-a-zA-Z0-9()@:%_\+.~\#?&\/=]*)};
@@ -2156,6 +2157,7 @@ sub process {
21562157
my $new_file = 0;
21572158
my $has_doc = 0;
21582159
my $has_test = 0;
2160+
my $has_deps = 0;
21592161
my $is_test = 0;
21602162

21612163
# Pre-scan the patch sanitizing the lines.
@@ -2767,6 +2769,9 @@ sub process {
27672769
if ($realfile =~ /^(?:static-build\/)?test\/.*\//) {
27682770
$has_test = 1;
27692771
}
2772+
if ($realfile =~ /^third_party\//) {
2773+
$has_deps = 1;
2774+
}
27702775

27712776
$is_test = ($realfile =~ /^(?:test|perf)\//);
27722777

@@ -5293,6 +5298,10 @@ sub process {
52935298
ERROR("NO_TEST",
52945299
"Please add test or NO_TEST=<reason> tag\n");
52955300
}
5301+
if (!$has_deps && !exists($commit_log_tags{'NO_DEPS'})) {
5302+
ERROR("NO_DEPS",
5303+
"Please update dependencies or add NO_DEPS=<reason> tag\n");
5304+
}
52965305
}
52975306

52985307
print report_dump();

doc/checkpatch.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,12 @@ Others
766766
If the patch doesn't need a test (e.g. it fixes a CI issue), please add
767767
NO_TEST=<reason> to the commit log.
768768

769+
**NO_DEPS**
770+
The patch has dependencies update. Please update dependencies versions or
771+
add a new entry to the file with dependencies extra/dependencies.yaml.
772+
If the patch doesn't update dependencies (e.g. it fixes a typo), please add
773+
NO_DEPS=<reason> to the commit log.
774+
769775
**NOT_UNIFIED_DIFF**
770776
The patch file does not appear to be in unified-diff format. Please
771777
regenerate the patch file before sending it to the maintainer.

0 commit comments

Comments
 (0)