Admin/isatest-lint
changeset 16309 39c793a9b382
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Admin/isatest-lint	Tue Jun 07 09:11:27 2005 +0200
     1.3 @@ -0,0 +1,41 @@
     1.4 +#!/usr/bin/env perl
     1.5 +#
     1.6 +# $Id$
     1.7 +# Author: Florian Haftmann, TUM
     1.8 +#
     1.9 +# Do consistency and quality checks on the isabelle sources
    1.10 +#
    1.11 +
    1.12 +use strict;
    1.13 +use File::Find;
    1.14 +use File::Basename;
    1.15 +
    1.16 +# configuration
    1.17 +my $isabelleRoot = $ENV{'HOME'} . "/isabelle";
    1.18 +my @suffices = ('\.thy', '\.ml', '\.ML');
    1.19 +
    1.20 +# lint main procedure
    1.21 +sub lint() {
    1.22 +    my ($basename, $dirname, $ext) = fileparse($File::Find::name, @suffices);
    1.23 +    if ($ext) {
    1.24 +        open ISTREAM, $File::Find::name or die("error opening $File::Find::name");
    1.25 +        my $found = 0;
    1.26 +        while (<ISTREAM>) {
    1.27 +            $found ||= m/\$Id[^\$]*\$/;
    1.28 +            last if $found;
    1.29 +        }
    1.30 +        close ISTREAM;
    1.31 +        my $relname = substr($File::Find::name, (length $isabelleRoot) + 1);
    1.32 +        if (! $found) {
    1.33 +            print "Found no CVS id in $relname\n";
    1.34 +        }
    1.35 +    }
    1.36 +}
    1.37 +
    1.38 +# first argument =^= isabelle repository root
    1.39 +if (@ARGV) {
    1.40 +    $isabelleRoot = $ARGV[0];
    1.41 +}
    1.42 +
    1.43 +find(\&lint, $isabelleRoot);
    1.44 +