From 4471b3549a5558525bb68e7b86dbf88fd427cfef Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 7 Dec 2024 09:44:46 -0800 Subject: [PATCH] add util to check line length --- dev-bin/check_perltidy_line_length.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 dev-bin/check_perltidy_line_length.pl 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"; +} -- 2.39.5