Admin/isatest/isatest-lint
author wenzelm
Wed, 26 Mar 2008 22:40:08 +0100
changeset 26416 a66f86ef7bb9
parent 22410 da313b67a04d
child 31582 4753c317d5c1
permissions -rw-r--r--
added store_thms etc. (formerly in Thy/thm_database.ML); added bind_thm(s) (formerly in old_goals.ML); adapted to Context.thread_data interface; removed obsolete get/set_context; renamed ML_Context.>> to Context.>> (again);

#!/usr/bin/env perl
#
# $Id$
# Author: Florian Haftmann, TUM
#
# Do consistency and quality checks on the isabelle sources
#

use strict;
use File::Find;
use File::Basename;

# configuration
my $isabelleRoot = $ENV{'HOME'} . "/isabelle";
my @suffices = ('\.thy', '\.ml', '\.ML');

# lint main procedure
sub lint() {
    my ($basename, $dirname, $ext) = fileparse($File::Find::name, @suffices);
    if ($ext) {
        open ISTREAM, $File::Find::name or die("error opening $File::Find::name");
        my $found = 0;
        while (<ISTREAM>) {
            $found ||= m/\$Id[^\$]*\$/;
            last if $found;
        }
        close ISTREAM;
        my $relname = substr($File::Find::name, (length $isabelleRoot) + 1);
        if (! $found) {
            print "Found no CVS id in $relname\n";
        }
    }
}

# first argument =^= isabelle repository root
if (@ARGV) {
    $isabelleRoot = $ARGV[0];
}

find(\&lint, $isabelleRoot);