mirror of
https://github.com/imapsync/imapsync.git
synced 2025-06-14 00:14:52 +02:00
1.836
This commit is contained in:
parent
3afeea4a16
commit
8d76e44c5e
243 changed files with 57452 additions and 10330 deletions
47
W/tools/validate_html4
Executable file
47
W/tools/validate_html4
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use WebService::Validator::HTML::W3C;
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This script takes files as arguments and then submits those file
|
||||
to the W3C validator. It will print out a line for each
|
||||
file stating if it is valid or otherwise. For the invalid files it will
|
||||
also print out the errors returned by the validator.
|
||||
|
||||
=cut
|
||||
|
||||
my $v = WebService::Validator::HTML::W3C->new(
|
||||
# you should probably install a local validator if you
|
||||
# are indenting to run this against a lot of files and
|
||||
# then uncomment this line and change the uri
|
||||
# validator_uri => 'http://localhost/w3c-validator/check',
|
||||
detailed => 1
|
||||
) or die "failed to init validator object";
|
||||
|
||||
my $invalid_found = 0 ;
|
||||
|
||||
for my $file ( @ARGV ) {
|
||||
if ( $v->validate_file( $file ) ) {
|
||||
if ( $v->is_valid ) {
|
||||
print "$file: valid\n";
|
||||
} else {
|
||||
$invalid_found = 1 ;
|
||||
print "$file: invalid\n";
|
||||
for my $err ( @{ $v->errors } ) {
|
||||
printf(" line: %s, col: %s\n error: %s\n\n",
|
||||
$err->line, $err->col, $err->msg);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die "failed to validate $file: " . $v->validator_error . "\n";
|
||||
}
|
||||
print "\n" . '-' x 60 . "\n";
|
||||
# sleep between files so as not to hammer the validator
|
||||
sleep 1;
|
||||
}
|
||||
|
||||
exit( $invalid_found ) ;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue