5 authors.pl - check modules and scripts for authors not in AUTHORS file
9 B<authors.pl> [B<-d|--dir> path ] [B<-v|--verbose>] B<-a|--authorsfile>
14 Checks Plain Old Documentation (POD) of all bioperl live modules for
15 AUTHORS and CONTRIBUTORS tags and prints out any emails missing from
28 # command line options
31 my ($verbose, $dir, $authorsfile, $help) = (0, undef, "../AUTHORS", undef);
33 'v|verbose' => \
$verbose,
35 'authorsfile:s' => \
$authorsfile,
36 'h|help|?' => sub{ exec('perldoc',$0); exit(0) }
43 # known authors from the AUTHORS file are read into
44 # the hash which is initialized with known synonymes
45 our %AUTHORS = map {$_=>1} qw{
49 fugui
@worf.fugu
-sg
.org
50 cjm
@fruitfly.bdgp
.berkeley
.edu
52 heikki
-at
-bioperl
-dot
-org
53 bioinformatics
@dieselwurks.com
54 bioinformatics1
@dieselwurks.com
55 bioperl
-l
@bio.perl
.org
56 paul
@systemsbiology.org
62 hilmar
.lapp
@pharma.novartis
.com
63 richard
.adams
@ed.ac
.uk
64 dblock
@gene.pbi
.nrc
.ca
69 m
.w
.e
.j
.fiers
@plant.wag
-ur
.nl
74 our %NEWAUTHORS; # new authors
75 our %FIND_OPTIONS = ( wanted
=> \
&findauthors
, no_chdir
=> 1 );
78 # Directories to check
79 my @dirs = qw( ../Bio/ ../scripts . );
81 #print Dumper \%AUTHORS;
84 # Read the AUTHORS file
88 open my $F, '<', $authorsfile or die "Could not read file '$authorsfile': $!\n";
91 while (my $line = <$F>) {
92 my ($email) = ($line =~/([\.\w_-]+ at [\.\w_-]+)/);
106 find \
%FIND_OPTIONS, $dir;
108 find \
%FIND_OPTIONS, @dirs;
114 print Dumper \
%NEWAUTHORS;
124 # this is where the action is
128 return unless ($filename =~ /\.PLS$/ or $filename =~ /\.p[ml]$/);
129 return unless -e
$filename;
131 print "$filename\n" if $verbose;
133 open my $F, '<', $filename or die "Could not read file '$filename': $!\n";
134 while (my $line = <$F>) {
136 last if $line =~ /=head1 +AUTHOR/;
139 while (my $line = <$F>) {
140 last if $line =~ /=head/ and $line !~ /CONTRIBUTORS/;
141 $authorblock .= $line;
144 return unless $authorblock;
146 while ( $authorblock =~ /([\.\w_-]+@[\.a-z_-]+)/g) {
149 next if $AUTHORS{$1};
150 #print "$filename\t$1\n";
152 push @
{$NEWAUTHORS{$1}}, $filename;
162 =item B<-d | --dir> path
164 Overides the default directories to check by one directory 'path' and
165 all its subdirectories.
167 =item B<-a | --authorsfile>
169 path from working directory the AUTHORS file.
171 Redundant as this information could be had from --dir option butI am
172 feeling too lazy to change the code.
178 return unless ($file =~ /\.PLS$/ or $file =~ /\.p[ml]$/);
179 return unless -e
$file;
181 open my $F, '<', $file or warn "Could not read file '$file': $!\n" && return;
183 while (my $line = <$F>) {
184 print "$file: +|$1|\n" if $line =~ /[ \t]\n(=[a-z][^\n]+$)/m and $verbose;
185 print "$file: ++|$1|\n" if $line =~ /\w\n(=[a-z][^\n]+$)/m and $verbose;
186 print "$file:|$1|+\n" if $line =~ /(^=[a-z][^\n]+)\n[\t ]/m;
187 #print "$file:|$1|++\n" if /(^=[^\n]+)\n\w/m;
194 =item B<-v | --verbose>
196 Show the progress through files during the POD checking.
198 =item B<-? | -h | --help>
208 User feedback is an integral part of the evolution of this and other
209 Bioperl modules. Send your comments and suggestions preferably to
210 the Bioperl mailing list. Your participation is much appreciated.
212 bioperl-l@bioperl.org - General discussion
213 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
215 =head2 Reporting Bugs
217 Report bugs to the Bioperl bug tracking system to help us keep track
218 of the bugs and their resolution. Bug reports can be submitted via the
221 https://github.com/bioperl/bioperl-live/issues
223 =head1 AUTHOR - Heikki Lehvaslaiho
225 Email heikki-at-bioperl-dot-org
230 # find . -name '*.pm' -print | xargs perl -e '$/=""; while (<>) {$n = $1 if /^package\s+([\w:]+)/; print "$n:|$1|" if /(\s\s^=[^\n]+$)/m ; }' ;
232 # find . -name '*.pm' -print | xargs perl -e '$/=""; while (<>) {$n = $1 if /^package\s+([\w:]+)/; print "$n:|$1|\n" if /(^=[^\n]+\n[\t ])/m ; }' ;