blob: 85245d124718cfdbb85b47e2bec3e669effbdde2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check that path patterns in MAINTAINERS have trailing slash
use strict;
use warnings;
open( my $file, "<", "MAINTAINERS" ) or die "Error: could not open file 'MAINTAINERS'\n";
while ( my $line = <$file> ) {
if ( $line =~ /^[FX]:\s+([^\s]*[^*\/\s])\s+$/ ) { # path patterns not ending with / or *
my $path = $1;
if ( -d $path ) {
print "MAINTAINERS:$. missing trailing slash for directory match ";
print "`$path`\n";
}
}
}
close($file);
|