From: Steve Hancock Date: Sat, 7 Dec 2024 17:44:46 +0000 (-0800) Subject: add util to check line length X-Git-Tag: 20240903.08~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4471b3549a5558525bb68e7b86dbf88fd427cfef;p=perltidy.git add util to check line length --- diff --git a/dev-bin/check_perltidy_line_length.pl b/dev-bin/check_perltidy_line_length.pl new file mode 100755 index 00000000..8d353345 --- /dev/null +++ b/dev-bin/check_perltidy_line_length.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w +use strict; + +# check that the lines with fixed lengths in the perltidy pod are not too long +my $fname='perltidy'; +my $fh; +if (!open($fh, '<', $fname)) { + print "cannot open $fname: $!\n"; +} +my @too_long; +my $lno=0; +while (my $line=<$fh>) { + $lno++; + my $excess=length($line)-80; + next if ($excess<=0); + next if ($line !~ /^\s/); + print "$lno:$excess:$line"; + push @too_long, $lno; +} +if (@too_long) { + my $num=@too_long; + print "$num lines exceed 80 chars:\n"; +}