summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-12-30 14:15:11 +0100
committerThomas Haller <thaller@redhat.com>2018-12-30 15:17:11 +0100
commite498f594bb6eec63e2f3f90f504414319105a158 (patch)
tree8370f25a2ee86af7efdc28dd77c3d8118b3677e1 /contrib
parentfc052494d1d76d7b3a39f0ba358666e5d3aeef05 (diff)
downloadNetworkManager-e498f594bb6eec63e2f3f90f504414319105a158.tar.gz
checkpatch: warn if there is a file "TODO.txt"
This allows us to add a file "TODO.txt" in the top level directory. This file is not intended to be merged to master, but keep track of stuff that is still to do before merging a branch. Let checkpatch.pl warn about the presence of such a file.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/checkpatch.pl20
1 files changed, 17 insertions, 3 deletions
diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl
index d0b59b5f22..829827b5e0 100755
--- a/contrib/scripts/checkpatch.pl
+++ b/contrib/scripts/checkpatch.pl
@@ -59,6 +59,7 @@ our $type;
our $filename;
our $line_no;
our $indent;
+our $check_is_todo;
sub new_hunk
{
@@ -68,6 +69,7 @@ sub new_hunk
sub new_file
{
+ $check_is_todo = 1;
$filename = shift;
@functions_seen = ();
}
@@ -77,6 +79,7 @@ my $header = $ENV{'NM_CHECKPATCH_HEADER'};
sub complain
{
my $message = shift;
+ my $plain_message = shift;
return unless $check_line;
@@ -85,8 +88,12 @@ sub complain
undef $header;
}
- warn "$filename:$line_no: $message:\n";
- warn "> $line\n\n";
+ if ($plain_message) {
+ warn "$message\n";
+ } else {
+ warn "$filename:$line_no: $message:\n";
+ warn "> $line\n\n";
+ }
$seen_error = 1;
}
@@ -126,7 +133,14 @@ if ($is_file and $filename ne $ARGV) {
new_hunk;
}
-next unless $filename =~ /\.[ch]$/;
+if ($filename !~ /\.[ch]$/) {
+ if ($check_is_todo) {
+ complain("Resolve todo list \"$filename\" first\n", 1) if $filename =~ /^TODO.txt$/;
+ $check_is_todo = 0;
+ }
+ next;
+}
+
next if $filename =~ /\/nm-[^\/]+-enum-types\.[ch]$/;
next if $filename =~ /\bsrc\/systemd\//
and not $filename =~ /\/sd-adapt\//