summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-01-03 10:16:33 +0000
committerfukachan <fukachan>2003-01-03 10:16:33 +0000
commit0678c1a65cfb1ba8a32b5f0fa5cbc12a6c4640f6 (patch)
tree2c63e20045e124f1bc7edbd651b871620d5c1e7a
parent06553e5a8fa490acffd8208af4840d75a7a68476 (diff)
downloadfml8-0678c1a65cfb1ba8a32b5f0fa5cbc12a6c4640f6.tar.gz
fml8-0678c1a65cfb1ba8a32b5f0fa5cbc12a6c4640f6.tar.bz2
fml8-0678c1a65cfb1ba8a32b5f0fa5cbc12a6c4640f6.zip
modify output format.
add copyright check.
-rwxr-xr-xregress/simulation/find_bad_style.pl19
-rwxr-xr-xregress/style/find_bad_style.pl19
2 files changed, 30 insertions, 8 deletions
diff --git a/regress/simulation/find_bad_style.pl b/regress/simulation/find_bad_style.pl
index d64949b6..c33df22a 100755
--- a/regress/simulation/find_bad_style.pl
+++ b/regress/simulation/find_bad_style.pl
@@ -1,10 +1,11 @@
#!/usr/bin/env perl
#
-# $FML$
+# $FML: find_bad_style.pl,v 1.1 2002/06/01 05:06:22 fukachan Exp $
#
use strict;
+my $copyright = '';
my $in_sub = 0;
my $in_head = 0;
my $defined = 0;
@@ -15,6 +16,15 @@ my $prev_argv = '';
my $prev_line = '';
while (<>) {
+ if (/^\#.*(Copyright.*)/i) {
+ $copyright = $1;
+ }
+
+ if (/^\#.*\$FML:.*(\d{4})\/\d{2}\/\d{2} /i) {
+ my $year = $1;
+ print "\n$ARGV\n\tcopyright wrong\n" unless $copyright =~ /$year/;
+ }
+
# reset the line number counter
if ($prev_argv ne $ARGV) {
$count = 0;
@@ -46,7 +56,8 @@ while (<>) {
if (/\$\S+\-\>(close|open)/ && (!/^sub /) && (!/^=head/) && (!/\$self/)) {
unless ($defined) {
$buf .= " ===> ". $_;
- print "<<<($ARGV $count)\n", $buf, "\n>>>\n\n";
+ $buf =~ s/\n/\n\t/gm; $buf =~ s/^/\t/;
+ print "\n$ARGV $count {\n\tdefined() ?\n\n", $buf, "\n}\n\n";
}
}
@@ -54,8 +65,8 @@ while (<>) {
#
# 2. check FNF
#
- if (/^sub / && ($prev_line !~ /^\#/)) {
- print "$ARGV $count (FNF)> $_";
+ if (/^sub / && ($prev_line !~ /^\#\s*\w+/)) {
+ print "\n$ARGV $count\n\t(FNF)> $_";
}
#
diff --git a/regress/style/find_bad_style.pl b/regress/style/find_bad_style.pl
index d64949b6..c33df22a 100755
--- a/regress/style/find_bad_style.pl
+++ b/regress/style/find_bad_style.pl
@@ -1,10 +1,11 @@
#!/usr/bin/env perl
#
-# $FML$
+# $FML: find_bad_style.pl,v 1.1 2002/06/01 05:06:22 fukachan Exp $
#
use strict;
+my $copyright = '';
my $in_sub = 0;
my $in_head = 0;
my $defined = 0;
@@ -15,6 +16,15 @@ my $prev_argv = '';
my $prev_line = '';
while (<>) {
+ if (/^\#.*(Copyright.*)/i) {
+ $copyright = $1;
+ }
+
+ if (/^\#.*\$FML:.*(\d{4})\/\d{2}\/\d{2} /i) {
+ my $year = $1;
+ print "\n$ARGV\n\tcopyright wrong\n" unless $copyright =~ /$year/;
+ }
+
# reset the line number counter
if ($prev_argv ne $ARGV) {
$count = 0;
@@ -46,7 +56,8 @@ while (<>) {
if (/\$\S+\-\>(close|open)/ && (!/^sub /) && (!/^=head/) && (!/\$self/)) {
unless ($defined) {
$buf .= " ===> ". $_;
- print "<<<($ARGV $count)\n", $buf, "\n>>>\n\n";
+ $buf =~ s/\n/\n\t/gm; $buf =~ s/^/\t/;
+ print "\n$ARGV $count {\n\tdefined() ?\n\n", $buf, "\n}\n\n";
}
}
@@ -54,8 +65,8 @@ while (<>) {
#
# 2. check FNF
#
- if (/^sub / && ($prev_line !~ /^\#/)) {
- print "$ARGV $count (FNF)> $_";
+ if (/^sub / && ($prev_line !~ /^\#\s*\w+/)) {
+ print "\n$ARGV $count\n\t(FNF)> $_";
}
#