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 (F
, $authorsfile) || die "can't open file $authorsfile: $!";
92 my ($email) = /([\.\w_-]+ at [\.\w_-]+)/;
106 find \
%FIND_OPTIONS, $dir;
108 find \
%FIND_OPTIONS, @dirs;
114 print Dumper \
%NEWAUTHORS;
124 # this is where the action is
127 return unless /\.PLS$/ or /\.p[ml]$/ ;
129 print "$_\n" if $verbose;
132 open F
, $_ || die "Could not open file $_";
135 last if /=head1 +AUTHOR/;
139 last if /=head/ and not /CONTRIBUTORS/;
142 return unless $authorblock;
143 while ( $authorblock =~ /([\.\w_-]+@[\.a-z_-]+)/g) {
146 next if $AUTHORS{$1};
147 #print "$filename\t$1\n";
149 push @
{$NEWAUTHORS{$1}}, $filename;
160 =item B<-d | --dir> path
162 Overides the default directories to check by one directory 'path' and
163 all its subdirectories.
165 =item B<-a | --authorsfile>
167 path from working directory the AUTHORS file.
169 Redundant as this information could be had from --dir option butI am
170 feeling too lazy to change the code.
175 return unless /\.PLS$/ or /\.p[ml]$/ ;
178 open (F
, $_) or warn "can't open file $_: $!" && return;
181 print "$file: +|$1|\n" if /[ \t]\n(=[a-z][^\n]+$)/m and $verbose;
182 print "$file: ++|$1|\n" if /\w\n(=[a-z][^\n]+$)/m and $verbose;
183 print "$file:|$1|+\n" if /(^=[a-z][^\n]+)\n[\t ]/m;
184 #print "$file:|$1|++\n" if /(^=[^\n]+)\n\w/m;
191 =item B<-v | --verbose>
193 Show the progress through files during the POD checking.
195 =item B<-? | -h | --help>
205 User feedback is an integral part of the evolution of this and other
206 Bioperl modules. Send your comments and suggestions preferably to
207 the Bioperl mailing list. Your participation is much appreciated.
209 bioperl-l@bioperl.org - General discussion
210 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
212 =head2 Reporting Bugs
214 Report bugs to the Bioperl bug tracking system to help us keep track
215 of the bugs and their resolution. Bug reports can be submitted via the
218 https://redmine.open-bio.org/projects/bioperl/
220 =head1 AUTHOR - Heikki Lehvaslaiho
222 Email heikki-at-bioperl-dot-org
227 # find . -name '*.pm' -print | xargs perl -e '$/=""; while (<>) {$n = $1 if /^package\s+([\w:]+)/; print "$n:|$1|" if /(\s\s^=[^\n]+$)/m ; }' ;
229 # find . -name '*.pm' -print | xargs perl -e '$/=""; while (<>) {$n = $1 if /^package\s+([\w:]+)/; print "$n:|$1|\n" if /(^=[^\n]+\n[\t ])/m ; }' ;