Fix nits in pod files.
[openssl.git] / util / doc-nit-check.pl
1 #! /usr/bin/env perl
2
3 require 5.10.0;
4 use warnings;
5 use strict;
6 use Pod::Checker;
7 use File::Find;
8
9 sub check()
10 {
11     my $errs = 0;
12     
13     my $contents = '';
14     {
15         local $/ = undef;
16         open POD, $_ or die "Couldn't open $_, $!";
17         $contents = <POD>;
18         close POD;
19     }
20     if ( $contents !~ /^=pod/ ) {
21         print "$_ doesn't start with =pod\n";
22         return 1;
23     }
24     if ( $contents !~ /=cut\n$/ ) {
25         print "$_ doesn't end with =cut\n";
26         return 1;
27     }
28     if ( $contents !~ /Copyright .* The OpenSSL Project Authors/ ) {
29         print "$_ missing copyright\n";
30         return 1;
31     }
32
33     $errs = podchecker($_, \*STDOUT);
34     $errs = 1 if $errs < 0;
35     return $errs;
36 }
37
38 my $errs = 0;
39 foreach (glob('*/*.pod')) {
40     $errs += &check($_);
41 }
42 exit $errs;