Skip to content

Commit 1736554

Browse files
committed
Check that patch has dependencies update
To disable the new check, one can add NO_DEPS_UPDATE tag to the commit message.
1 parent c5a5294 commit 1736554

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎checkpatch.pl‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,10 @@ sub hash_show_words {
500500
NO_CHANGELOG
501501
)};
502502

503+
our $custom_tags_no_reason = qr{(?x:
504+
NO_DEPS_UPDATE
505+
)};
506+
503507
our $github_ref = qr{(https?:\/\/)?(www\.)?github\.com\b([-a-zA-Z0-9()@:%_\+.~\#?&\/=]*)};
504508
our $github_issue_ref = qr{((tarantool\/\S+)?\#[1-9][0-9]*)};
505509

@@ -2156,6 +2160,7 @@ sub process {
21562160
my $new_file = 0;
21572161
my $has_doc = 0;
21582162
my $has_test = 0;
2163+
my $need_deps_update = 0;
21592164
my $is_test = 0;
21602165

21612166
# Pre-scan the patch sanitizing the lines.
@@ -2747,7 +2752,8 @@ sub process {
27472752
}
27482753
}
27492754

2750-
if ($in_commit_log && $line =~ /^($custom_tags)=/) {
2755+
if ($in_commit_log && ($line =~ /^($custom_tags)=/ ||
2756+
$line =~ /^($custom_tags_no_reason)$/)) {
27512757
$commit_log_tags{$1} = 1;
27522758
if ($has_doc) {
27532759
ERROR("TAG_IN_DOC",
@@ -2767,6 +2773,9 @@ sub process {
27672773
if ($realfile =~ /^(?:static-build\/)?test\/.*\//) {
27682774
$has_test = 1;
27692775
}
2776+
if ($realfile =~ /^(?:third_party|cmake)\//) {
2777+
$need_deps_update = 1;
2778+
}
27702779

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

@@ -5293,6 +5302,11 @@ sub process {
52935302
ERROR("NO_TEST",
52945303
"Please add test or NO_TEST=<reason> tag\n");
52955304
}
5305+
if ($need_deps_update && !exists($commit_log_tags{'NO_DEPS_UPDATE'}) &&
5306+
!($filename !~ /^extra\/dependencies\.yaml$/)) {
5307+
ERROR("NO_DEPS_UPDATE",
5308+
"Please update extra/dependencies.yaml or add NO_DEPS_UPDATE tag\n");
5309+
}
52965310
}
52975311

52985312
print report_dump();

‎doc/checkpatch.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,13 @@ 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_UPDATE**
770+
The patch updates files that may describe external dependencies of the
771+
project. If it does introduce a new build dependency or updates the version
772+
of an existing build dependency, please update extra/dependencies.yaml
773+
accordingly, otherwise add NO_DEPS_UPDATE to the commit log to suppress
774+
this warning.
775+
769776
**NOT_UNIFIED_DIFF**
770777
The patch file does not appear to be in unified-diff format. Please
771778
regenerate the patch file before sending it to the maintainer.

0 commit comments

Comments
 (0)