| 16309 |      1 | #!/usr/bin/env perl
 | 
|  |      2 | #
 | 
|  |      3 | # $Id$
 | 
|  |      4 | # Author: Florian Haftmann, TUM
 | 
|  |      5 | #
 | 
|  |      6 | # Do consistency and quality checks on the isabelle sources
 | 
|  |      7 | #
 | 
|  |      8 | 
 | 
|  |      9 | use strict;
 | 
|  |     10 | use File::Find;
 | 
|  |     11 | use File::Basename;
 | 
|  |     12 | 
 | 
|  |     13 | # configuration
 | 
|  |     14 | my $isabelleRoot = $ENV{'HOME'} . "/isabelle";
 | 
|  |     15 | my @suffices = ('\.thy', '\.ml', '\.ML');
 | 
|  |     16 | 
 | 
|  |     17 | # lint main procedure
 | 
|  |     18 | sub lint() {
 | 
|  |     19 |     my ($basename, $dirname, $ext) = fileparse($File::Find::name, @suffices);
 | 
|  |     20 |     if ($ext) {
 | 
|  |     21 |         open ISTREAM, $File::Find::name or die("error opening $File::Find::name");
 | 
|  |     22 |         my $found = 0;
 | 
|  |     23 |         while (<ISTREAM>) {
 | 
|  |     24 |             $found ||= m/\$Id[^\$]*\$/;
 | 
|  |     25 |             last if $found;
 | 
|  |     26 |         }
 | 
|  |     27 |         close ISTREAM;
 | 
|  |     28 |         my $relname = substr($File::Find::name, (length $isabelleRoot) + 1);
 | 
|  |     29 |         if (! $found) {
 | 
|  |     30 |             print "Found no CVS id in $relname\n";
 | 
|  |     31 |         }
 | 
|  |     32 |     }
 | 
|  |     33 | }
 | 
|  |     34 | 
 | 
|  |     35 | # first argument =^= isabelle repository root
 | 
|  |     36 | if (@ARGV) {
 | 
|  |     37 |     $isabelleRoot = $ARGV[0];
 | 
|  |     38 | }
 | 
|  |     39 | 
 | 
|  |     40 | find(\&lint, $isabelleRoot);
 | 
|  |     41 | 
 |