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