Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ sub hash_show_words {
NO_DOC|
NO_TEST|
NO_CHANGELOG
NO_DEPS
)};

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

# Pre-scan the patch sanitizing the lines.
Expand Down Expand Up @@ -2767,6 +2769,9 @@ sub process {
if ($realfile =~ /^(?:static-build\/)?test\/.*\//) {
$has_test = 1;
}
if ($realfile =~ /^third_party\//) {
$has_deps = 1;
}

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

Expand Down Expand Up @@ -5293,6 +5298,10 @@ sub process {
ERROR("NO_TEST",
"Please add test or NO_TEST=<reason> tag\n");
}
if (!$has_deps && !exists($commit_log_tags{'NO_DEPS'})) {
ERROR("NO_DEPS",
"Please update dependencies or add NO_DEPS=<reason> tag\n");
}
}

print report_dump();
Expand Down
6 changes: 6 additions & 0 deletions doc/checkpatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,12 @@ Others
If the patch doesn't need a test (e.g. it fixes a CI issue), please add
NO_TEST=<reason> to the commit log.

**NO_DEPS**
The patch has dependencies update. Please update dependencies versions or
add a new entry to the file with dependencies extra/dependencies.yaml.
If the patch doesn't update dependencies (e.g. it fixes a typo), please add
NO_DEPS=<reason> to the commit log.

**NOT_UNIFIED_DIFF**
The patch file does not appear to be in unified-diff format. Please
regenerate the patch file before sending it to the maintainer.
Expand Down