From: schwarze Date: Fri, 23 Jun 2017 19:07:25 +0000 (+0000) Subject: delete -r, RCS id checks are now covered by mandoc, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=65a1854f6ecbb660160f6d0a5c7fc80e33a41280;p=openbsd delete -r, RCS id checks are now covered by mandoc, and garbage collect the unused "inliteral" state variable; ok jmc@ --- diff --git a/regress/usr.bin/mdoclint/mdoclint b/regress/usr.bin/mdoclint/mdoclint index a5e6ec34959..771b5bbb4b3 100644 --- a/regress/usr.bin/mdoclint/mdoclint +++ b/regress/usr.bin/mdoclint/mdoclint @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# $OpenBSD: mdoclint,v 1.69 2017/06/17 19:17:41 schwarze Exp $ +# $OpenBSD: mdoclint,v 1.70 2017/06/23 19:07:25 schwarze Exp $ # $NetBSD: mdoclint,v 1.77 2017/06/08 10:19:56 wiz Exp $ # # Copyright (c) 2001-2017 Thomas Klausner @@ -43,13 +43,13 @@ use constant { use vars qw( $opt_D $opt_F $opt_h - $opt_m $opt_o $opt_p $opt_r $opt_S $opt_v $opt_w $opt_x + $opt_m $opt_o $opt_p $opt_S $opt_v $opt_w $opt_x ); my $arch=`uname -m`; chomp($arch); -my $options="DFhmoprSvwx"; +my $options="DFhmopSvwx"; sub usage { @@ -62,12 +62,11 @@ usage: mdoclint [-$options] file ... -m warn about man pages that are not in mdoc(7) format -o warn about non-empty .Os strings -p warn about punctuation problems - -r warn about missing RCS Id -S warn about any .Sh weirdness -v verbose output -w show section header in warnings -x warn about cross-references with missing targets -Default is -DmoprSx if no flag is specified. +Default is -DmopSx if no flag is specified. EOF exit(0); } @@ -164,10 +163,8 @@ sub handle_options $opt_h and usage(); # default to all warnings if no flag is set - unless ($opt_D or $opt_m - or $opt_o or $opt_p or $opt_r or $opt_S or $opt_x) { - $opt_D = $opt_m = - $opt_o = $opt_p = $opt_r = $opt_S = $opt_x = 1; + unless ($opt_D or $opt_m or $opt_o or $opt_p or $opt_S or $opt_x) { + $opt_D = $opt_m = $opt_o = $opt_p = $opt_S = $opt_x = 1; } } @@ -214,9 +211,6 @@ sub new all => [], lastline => '', changes => 0, - oxrcsidseen => 0, - nxrcsidseen => 0, - inliteral => 0, shseen => {}, current_section_header => '', sec => '0', @@ -297,20 +291,6 @@ sub process_line chomp; # always cut trailing spaces s/\s+$//o; - if (/\$OpenBSD\b.*\$/o) { - $s->{oxrcsidseen}++; - if (OPENBSD and ($s->{oxrcsidseen} > 1)) { - $s->warning("RCS Id seen twice") if $opt_r; - } - return "$_\n"; - } - if (/[\$]NetBSD\b.*\$/o) { - $s->{nxrcsidseen}++; - if (NETBSD and ($s->{nxrcsidseen} > 1)) { - $s->warning("RCS Id seen twice") if $opt_r; - } - return "$_\n"; - } # comments if (/^\.\\\"/) { return "$_\n"; @@ -388,15 +368,6 @@ sub process_line } } } - if (/^\.Bd\b.*-(?:literal|unfilled)\b/o) { - $s->{inliteral} = 1; - } - if ($s->{inliteral} == 1) { - if (/^\.Ed\b/o) { - $s->{inliteral} = 0; - } - } - $s->{lastline} = $_; return "$_\n"; } @@ -405,12 +376,6 @@ sub finish { my ($s) = @_; - if (NETBSD and not $s->{nxrcsidseen}) { - $s->warning("Missing RCS Id") if $opt_r; - } - if (OPENBSD and not $s->{oxrcsidseen}) { - $s->warning("Missing RCS Id") if $opt_r; - } if ($s->{mandoc_p}) { foreach my $i (qw(NAME SYNOPSIS DESCRIPTION)) { if (not ($s->{shseen}{$i})) { diff --git a/regress/usr.bin/mdoclint/mdoclint.1 b/regress/usr.bin/mdoclint/mdoclint.1 index 32578a90cfc..b2b85e01a71 100644 --- a/regress/usr.bin/mdoclint/mdoclint.1 +++ b/regress/usr.bin/mdoclint/mdoclint.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mdoclint.1,v 1.27 2017/06/17 19:17:41 schwarze Exp $ +.\" $OpenBSD: mdoclint.1,v 1.28 2017/06/23 19:07:25 schwarze Exp $ .\" $NetBSD: mdoclint.1,v 1.23 2017/06/08 10:19:56 wiz Exp $ .\" .\" Copyright (c) 2001-2013 Thomas Klausner @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: June 17 2017 $ +.Dd $Mdocdate: June 23 2017 $ .Dt MDOCLINT 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd man page verifier .Sh SYNOPSIS .Nm -.Op Fl DFhmoprSvwx +.Op Fl DFhmopSvwx .Ar .Sh DESCRIPTION .Nm @@ -41,7 +41,7 @@ is a man page verifier. It tries to automatically find as many common errors that occur when writing man pages as possible. If no flags are given, -.Fl DmoprSx +.Fl DmopSx is assumed (that is, everything except .Fl Fhvw ) . .Pp @@ -65,8 +65,6 @@ the current version is default). .It Fl p Warn about possible punctuation problems at the end of macro arguments and abuse of .Ns to get punctuation directly next to a word. -.It Fl r -Warn about missing RCS Id. .It Fl S Warn about any unknown sections or about a section that comes in the wrong order (see