Skip to content

Commit f8dda47

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. Signed-off-by: Sergey Bronnikov <sergeyb@tarantool.org> Reviewed-by: Vladimir Davydov <vdavydov@tarantool.org>
1 parent c5a5294 commit f8dda47

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

‎checkpatch.pl‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ sub hash_show_words {
497497
our $custom_tags = qr{(?x:
498498
NO_DOC|
499499
NO_TEST|
500-
NO_CHANGELOG
500+
NO_CHANGELOG|
501+
NO_DEPS_UPDATE
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.
@@ -2747,7 +2749,7 @@ sub process {
27472749
}
27482750
}
27492751

2750-
if ($in_commit_log && $line =~ /^($custom_tags)=/) {
2752+
if ($in_commit_log && $line =~ /^($custom_tags)=?/) {
27512753
$commit_log_tags{$1} = 1;
27522754
if ($has_doc) {
27532755
ERROR("TAG_IN_DOC",
@@ -2767,6 +2769,9 @@ sub process {
27672769
if ($realfile =~ /^(?:static-build\/)?test\/.*\//) {
27682770
$has_test = 1;
27692771
}
2772+
if ($realfile =~ /^(?:third_party|cmake)\//) {
2773+
$has_deps = 1;
2774+
}
27702775

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

@@ -5293,6 +5298,11 @@ 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_UPDATE'}) &&
5302+
!($filename !~ /^extra\/dependencies\.yaml$/)) {
5303+
ERROR("NO_DEPS_UPDATE",
5304+
"Please update dependencies or add NO_DEPS_UPDATE tag\n");
5305+
}
52965306
}
52975307

52985308
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_UPDATE**
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_UPDATE 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)