| 1 | # You may distribute under the terms of either the GNU General Public License | ||
| 2 | # or the Artistic License (the same terms as Perl itself) | ||
| 3 | # | ||
| 4 | # (C) Paul Evans, 2023 -- leonerd@leonerd.org.uk | ||
| 5 | |||
| 6 | use v5.36; | ||
| 7 | use Object::Pad 0.807; | ||
| 8 | |||
| 9 | class App::perl::distrolint::Check::FilePaths 0.09; | ||
| 10 | |||
| 11 | apply App::perl::distrolint::CheckRole::EachFile; | ||
| 12 | |||
| 13 | use constant DESC => "check that filename paths appear to be sensible"; | ||
| 14 | use constant SORT => 9; | ||
| 15 | |||
| 16 | =head1 NAME | ||
| 17 | |||
| 18 | C<App::perl::distrolint::Check::FilePaths> - check that file paths are sensible | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This checks that path names of files appear to be sensible. | ||
| 23 | |||
| 24 | Currently the only check per filename is that it does not contain a C<:> | ||
| 25 | symbol, as this will upset Windows filesystems. | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | method run ( $app ) | ||
| 30 | { | ||
| 31 | return $self->run_for_each_file( check_file => ); | ||
| 32 | } | ||
| 33 | |||
| 34 | method check_file ( $file ) | ||
| 35 | { | ||
| 36 | $file =~ m/:/ and | ||
| 37 | App->diag( App->format_file( $file ), " is named with ':' which will upset Windows" ), return 0; | ||
| 38 | |||
| 39 | return 1; | ||
| 40 | } | ||
| 41 | |||
| 42 | =head1 AUTHOR | ||
| 43 | |||
| 44 | Paul Evans <leonerd@leonerd.org.uk> | ||
| 45 | |||
| 46 | =cut | ||
| 47 | |||
| 48 | 0x55AA; |