6 authors.pl - check modules and scripts for authors not in AUTHORS file
10 B<authors.pl> [B<-d|--dir> path ] [B<-v|--verbose>] B<-a|--authorsfile>
15 Checks Plain Old Documentation (POD) of all bioperl live modules for
16 AUTHORS and CONTRIBUTORS tags and prints out any emails missing from
29 # command line options
32 my ($verbose, $dir, $authorsfile, $help) = (0, undef, "../AUTHORS", undef);
34 'v|verbose' => \
$verbose,
36 'authorsfile:s' => \
$authorsfile,
37 'h|help|?' => sub{ exec('perldoc',$0); exit(0) }
44 # known authors from the AUTHORS file are read into
45 # the hash which is initialized with known synonymes
46 our %AUTHORS = map {$_=>1} qw{
50 fugui
@worf.fugu
-sg
.org
51 cjm
@fruitfly.bdgp
.berkeley
.edu
53 heikki
-at
-bioperl
-dot
-org
54 bioinformatics
@dieselwurks.com
55 bioinformatics1
@dieselwurks.com
56 bioperl
-l
@bio.perl
.org
57 paul
@systemsbiology.org
63 hilmar
.lapp
@pharma.novartis
.com
64 richard
.adams
@ed.ac
.uk
65 dblock
@gene.pbi
.nrc
.ca
70 m
.w
.e
.j
.fiers
@plant.wag
-ur
.nl
75 our %NEWAUTHORS; # new authors
76 our %FIND_OPTIONS = ( wanted
=> \
&findauthors
, no_chdir
=> 1 );
79 # Directories to check
80 my @dirs = qw( ../Bio/ ../scripts . );
82 #print Dumper \%AUTHORS;
85 # Read the AUTHORS file
89 open (F
, $authorsfile) || die "can't open file $authorsfile: $!";
93 my ($email) = /([\.\w_-]+ at [\.\w_-]+)/;
107 find \
%FIND_OPTIONS, $dir;
109 find \
%FIND_OPTIONS, @dirs;
115 print Dumper \
%NEWAUTHORS;
125 # this is where the action is
128 return unless /\.PLS$/ or /\.p[ml]$/ ;
130 print "$_\n" if $verbose;
133 open F
, $_ || die "Could not open file $_";
136 last if /=head1 +AUTHOR/;
140 last if /=head/ and not /CONTRIBUTORS/;
143 return unless $authorblock;
144 while ( $authorblock =~ /([\.\w_-]+@[\.a-z_-]+)/g) {
147 next if $AUTHORS{$1};
148 #print "$filename\t$1\n";
150 push @
{$NEWAUTHORS{$1}}, $filename;
161 =item B<-d | --dir> path
163 Overides the default directories to check by one directory 'path' and
164 all its subdirectories.
166 =item B<-a | --authorsfile>
168 path from working directory the AUTHORS file.
170 Redundant as this information could be had from --dir option butI am
171 feeling too lazy to change the code.
176 return unless /\.PLS$/ or /\.p[ml]$/ ;
179 open (F
, $_) or warn "can't open file $_: $!" && return;
182 print "$file: +|$1|\n" if /[ \t]\n(=[a-z][^\n]+$)/m and $verbose;
183 print "$file: ++|$1|\n" if /\w\n(=[a-z][^\n]+$)/m and $verbose;
184 print "$file:|$1|+\n" if /(^=[a-z][^\n]+)\n[\t ]/m;
185 #print "$file:|$1|++\n" if /(^=[^\n]+)\n\w/m;
192 =item B<-v | --verbose>
194 Show the progress through files during the POD checking.
196 =item B<-? | -h | --help>
206 User feedback is an integral part of the evolution of this and other
207 Bioperl modules. Send your comments and suggestions preferably to
208 the Bioperl mailing list. Your participation is much appreciated.
210 bioperl-l@bioperl.org - General discussion
211 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
213 =head2 Reporting Bugs
215 Report bugs to the Bioperl bug tracking system to help us keep track
216 of the bugs and their resolution. Bug reports can be submitted via the
219 http://bugzilla.open-bio.org/
221 =head1 AUTHOR - Heikki Lehvaslaiho
223 Email heikki-at-bioperl-dot-org
228 # find . -name '*.pm' -print | xargs perl -e '$/=""; while (<>) {$n = $1 if /^package\s+([\w:]+)/; print "$n:|$1|" if /(\s\s^=[^\n]+$)/m ; }' ;
230 # find . -name '*.pm' -print | xargs perl -e '$/=""; while (<>) {$n = $1 if /^package\s+([\w:]+)/; print "$n:|$1|\n" if /(^=[^\n]+\n[\t ])/m ; }' ;