Wed Jun 7 19:09:55 2017 UTC ()
Remove -n, mandoc now has a warning for this case.

>From Ingo Schwarze.

Bump version.


(wiz)
diff -r1.65 -r1.66 pkgsrc/textproc/mdoclint/Makefile
diff -r1.74 -r1.75 pkgsrc/textproc/mdoclint/files/mdoclint
diff -r1.20 -r1.21 pkgsrc/textproc/mdoclint/files/mdoclint.1

cvs diff -r1.65 -r1.66 pkgsrc/textproc/mdoclint/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/textproc/mdoclint/Attic/Makefile 2017/06/01 14:38:50 1.65
+++ pkgsrc/textproc/mdoclint/Attic/Makefile 2017/06/07 19:09:55 1.66
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.65 2017/06/01 14:38:50 wiz Exp $ 1# $NetBSD: Makefile,v 1.66 2017/06/07 19:09:55 wiz Exp $
2 2
3DISTNAME= mdoclint-1.54 3DISTNAME= mdoclint-1.55
4CATEGORIES= textproc 4CATEGORIES= textproc
5MASTER_SITES= # none 5MASTER_SITES= # none
6DISTFILES= # none 6DISTFILES= # none
7 7
8OWNER= wiz@NetBSD.org 8OWNER= wiz@NetBSD.org
9#HOMEPAGE= # 9#HOMEPAGE= #
10COMMENT= Tool for verifying man pages 10COMMENT= Tool for verifying man pages
11LICENSE= 2-clause-bsd 11LICENSE= 2-clause-bsd
12 12
13INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 13INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
14 14
15WRKSRC= ${WRKDIR} 15WRKSRC= ${WRKDIR}
16NO_BUILD= yes 16NO_BUILD= yes

cvs diff -r1.74 -r1.75 pkgsrc/textproc/mdoclint/files/Attic/mdoclint (expand / switch to unified diff)

--- pkgsrc/textproc/mdoclint/files/Attic/mdoclint 2017/06/01 14:38:50 1.74
+++ pkgsrc/textproc/mdoclint/files/Attic/mdoclint 2017/06/07 19:09:55 1.75
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1#!@PERL5@ 1#!@PERL5@
2# 2#
3# $OpenBSD: mdoclint,v 1.48 2016/01/24 20:10:48 schwarze Exp $ 3# $OpenBSD: mdoclint,v 1.48 2016/01/24 20:10:48 schwarze Exp $
4# $NetBSD: mdoclint,v 1.74 2017/06/01 14:38:50 wiz Exp $ 4# $NetBSD: mdoclint,v 1.75 2017/06/07 19:09:55 wiz Exp $
5# 5#
6# Copyright (c) 2001-2017 Thomas Klausner 6# Copyright (c) 2001-2017 Thomas Klausner
7# All rights reserved. 7# All rights reserved.
8# 8#
9# Redistribution and use in source and binary forms, with or without 9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions 10# modification, are permitted provided that the following conditions
11# are met: 11# are met:
12# 1. Redistributions of source code must retain the above copyright 12# 1. Redistributions of source code must retain the above copyright
13# notice, this list of conditions and the following disclaimer. 13# notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright 14# 2. Redistributions in binary form must reproduce the above copyright
15# notice, this list of conditions and the following disclaimer in the 15# notice, this list of conditions and the following disclaimer in the
16# documentation and/or other materials provided with the distribution. 16# documentation and/or other materials provided with the distribution.
17# 17#
@@ -33,49 +33,48 @@ use warnings; @@ -33,49 +33,48 @@ use warnings;
33 33
34$| = 1; 34$| = 1;
35 35
36package Parser; 36package Parser;
37use Getopt::Std; 37use Getopt::Std;
38 38
39use constant { 39use constant {
40 OPENBSD => 0, 40 OPENBSD => 0,
41 NETBSD => 1, 41 NETBSD => 1,
42}; 42};
43 43
44use vars qw( 44use vars qw(
45 $opt_D $opt_d $opt_e $opt_F $opt_h $opt_l 45 $opt_D $opt_d $opt_e $opt_F $opt_h $opt_l
46 $opt_m $opt_n $opt_o $opt_p $opt_r $opt_S $opt_v $opt_w $opt_x 46 $opt_m $opt_o $opt_p $opt_r $opt_S $opt_v $opt_w $opt_x
47); 47);
48 48
49 49
50my $arch=`uname -m`; 50my $arch=`uname -m`;
51chomp($arch); 51chomp($arch);
52my $options="aDdeFfHhlmnoprSvwXx"; 52my $options="DdeFhlmoprSvwx";
53 53
54sub usage 54sub usage
55 { 55 {
56 my $default = OPENBSD ? "-DdmnoprSx" : "-DdelmnoprSx"; 56 my $default = OPENBSD ? "-DdmoprSx" : "-DdelmoprSx";
57 57
58 print STDERR <<"EOF"; 58 print STDERR <<"EOF";
59mdoclint: verify man page correctness 59mdoclint: verify man page correctness
60usage: mdoclint [-$options] file ... 60usage: mdoclint [-$options] file ...
61 -D warn about bad casing and archs in .Dt 61 -D warn about bad casing and archs in .Dt
62 -d warn about bad date strings (in .Dd only) 62 -d warn about bad date strings (in .Dd only)
63 -e warn about unsorted errors (for functions) 63 -e warn about unsorted errors (for functions)
64 -F fix whitespace problems (asks before overwriting) 64 -F fix whitespace problems (asks before overwriting)
65 -h display this help text 65 -h display this help text
66 -l warn about unknown libraries 66 -l warn about unknown libraries
67 -m warn about man pages that are not in mdoc(7) format 67 -m warn about man pages that are not in mdoc(7) format
68 -n warn about .Nd's ending in '.' 
69 -o warn about non-empty .Os strings 68 -o warn about non-empty .Os strings
70 -p warn about punctuation problems 69 -p warn about punctuation problems
71 -r warn about missing RCS Id 70 -r warn about missing RCS Id
72 -S warn about any .Sh weirdness 71 -S warn about any .Sh weirdness
73 -v verbose output 72 -v verbose output
74 -w show section header in warnings 73 -w show section header in warnings
75 -x warn about cross-references with missing targets 74 -x warn about cross-references with missing targets
76Default is $default if no flag is specified. 75Default is $default if no flag is specified.
77EOF 76EOF
78 exit(0); 77 exit(0);
79} 78}
80 79
81 80
@@ -226,32 +225,30 @@ sub warning @@ -226,32 +225,30 @@ sub warning
226 my $extra = ""; 225 my $extra = "";
227 if ($opt_w) { 226 if ($opt_w) {
228 $extra = $self->{current_section_header}.":"; 227 $extra = $self->{current_section_header}.":";
229 } 228 }
230 print STDOUT "$self->{fn}:$extra$self->{ln}: ", join('', @_), "\n"; 229 print STDOUT "$self->{fn}:$extra$self->{ln}: ", join('', @_), "\n";
231} 230}
232 231
233sub handle_options 232sub handle_options
234{ 233{
235 getopts($options); 234 getopts($options);
236 $opt_h and usage(); 235 $opt_h and usage();
237 236
238 # default to all warnings if no flag is set 237 # default to all warnings if no flag is set
239 unless ($opt_D or $opt_d or $opt_e or $opt_l 238 unless ($opt_D or $opt_d or $opt_e or $opt_l or $opt_m
240 or $opt_m or $opt_n or $opt_o or $opt_p or $opt_r 239 or $opt_o or $opt_p or $opt_r or $opt_S or $opt_x) {
241 or $opt_S or $opt_x) { 
242 $opt_D = $opt_d = $opt_m = 240 $opt_D = $opt_d = $opt_m =
243 $opt_n = $opt_o = $opt_p = $opt_r = $opt_S = 241 $opt_o = $opt_p = $opt_r = $opt_S = $opt_x = 1;
244 $opt_x = 1; 
245 $opt_e = $opt_l = 1 if NETBSD; 242 $opt_e = $opt_l = 1 if NETBSD;
246 } 243 }
247} 244}
248 245
249 246
250sub verify_xref 247sub verify_xref
251{ 248{
252 my ($self, $page, $section, $pre, $post) = @_; 249 my ($self, $page, $section, $pre, $post) = @_;
253 if ($self->{names}{$page.$section}) { 250 if ($self->{names}{$page.$section}) {
254 $self->warning("Xref to itself (use .Nm instead)") if $opt_x; 251 $self->warning("Xref to itself (use .Nm instead)") if $opt_x;
255 } 252 }
256 # try to find corresponding man page 253 # try to find corresponding man page
257 if (OPENBSD) { 254 if (OPENBSD) {
@@ -428,30 +425,26 @@ sub process_line @@ -428,30 +425,26 @@ sub process_line
428 $s->{names}{$1.$s->{sec}} = 1; 425 $s->{names}{$1.$s->{sec}} = 1;
429 } 426 }
430 } 427 }
431 428
432 if (/^\.Lb\s+(\S+)/o) { 429 if (/^\.Lb\s+(\S+)/o) {
433 if (not $libraries{$1}) { 430 if (not $libraries{$1}) {
434 $s->warning("Unknown library `$1' used as Lb argument") if $opt_l; 431 $s->warning("Unknown library `$1' used as Lb argument") if $opt_l;
435 } 432 }
436 } 433 }
437 if (/^\.Os\s+(.+)/o) { 434 if (/^\.Os\s+(.+)/o) {
438 $s->warning(".Os used with argument `$1'") if $opt_o; 435 $s->warning(".Os used with argument `$1'") if $opt_o;
439 } 436 }
440 437
441 if (/^\.Nd.*\.$/o) { 
442 $s->warning(".Nd ends with a dot: `$_'") if $opt_n; 
443 } 
444 
445 if (/(\w\w)\.\s+[A-Z]/o and not /^.%T/ and not $s->{inliteral}) { 438 if (/(\w\w)\.\s+[A-Z]/o and not /^.%T/ and not $s->{inliteral}) {
446 if ("$1" ne "St") { 439 if ("$1" ne "St") {
447 $s->warning("new sentence, new line: `$_'") if $opt_p; 440 $s->warning("new sentence, new line: `$_'") if $opt_p;
448 } 441 }
449 } 442 }
450 if (/^\... .*[^\s][\.();,\[\]\{\}:]$/o 443 if (/^\... .*[^\s][\.();,\[\]\{\}:]$/o
451 and not /\s\.\.\.$/o and not /\\&.$/o) { 444 and not /\s\.\.\.$/o and not /\\&.$/o) {
452 $s->warning("punctuation in format string ", 445 $s->warning("punctuation in format string ",
453 "without space: `$_'") if $opt_p; 446 "without space: `$_'") if $opt_p;
454 } 447 }
455 if (/^\./o and /Ns [\.();,\[\]\{\}:]/o) { 448 if (/^\./o and /Ns [\.();,\[\]\{\}:]/o) {
456 $s->warning("possible Ns abuse: `$_'") if $opt_p; 449 $s->warning("possible Ns abuse: `$_'") if $opt_p;
457 } 450 }

cvs diff -r1.20 -r1.21 pkgsrc/textproc/mdoclint/files/Attic/mdoclint.1 (expand / switch to unified diff)

--- pkgsrc/textproc/mdoclint/files/Attic/mdoclint.1 2017/06/01 14:38:50 1.20
+++ pkgsrc/textproc/mdoclint/files/Attic/mdoclint.1 2017/06/07 19:09:55 1.21
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1.\" $OpenBSD: mdoclint.1,v 1.7 2009/04/13 19:06:38 jmc Exp $ 1.\" $OpenBSD: mdoclint.1,v 1.7 2009/04/13 19:06:38 jmc Exp $
2.\" $NetBSD: mdoclint.1,v 1.20 2017/06/01 14:38:50 wiz Exp $ 2.\" $NetBSD: mdoclint.1,v 1.21 2017/06/07 19:09:55 wiz Exp $
3.\" 3.\"
4.\" Copyright (c) 2001-2013 Thomas Klausner 4.\" Copyright (c) 2001-2013 Thomas Klausner
5.\" All rights reserved. 5.\" All rights reserved.
6.\" 6.\"
7.\" Redistribution and use in source and binary forms, with or without 7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions 8.\" modification, are permitted provided that the following conditions
9.\" are met: 9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright 10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer. 11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the 13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution. 14.\" documentation and/or other materials provided with the distribution.
15.\" 15.\"
@@ -23,59 +23,56 @@ @@ -23,59 +23,56 @@
23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26.\" POSSIBILITY OF SUCH DAMAGE. 26.\" POSSIBILITY OF SUCH DAMAGE.
27.\" 27.\"
28.Dd May 15, 2017 28.Dd May 15, 2017
29.Dt MDOCLINT 1 29.Dt MDOCLINT 1
30.Os 30.Os
31.Sh NAME 31.Sh NAME
32.Nm mdoclint 32.Nm mdoclint
33.Nd man page verifier 33.Nd man page verifier
34.Sh SYNOPSIS 34.Sh SYNOPSIS
35.Nm 35.Nm
36.Op Fl DdeFhlmnoprSvwx 36.Op Fl DdeFhlmoprSvwx
37.Ar 37.Ar
38.Sh DESCRIPTION 38.Sh DESCRIPTION
39.Nm 39.Nm
40is a man page verifier. 40is a man page verifier.
41It tries to automatically find as many common 41It tries to automatically find as many common
42errors that occur when writing man pages as possible. 42errors that occur when writing man pages as possible.
43If no flags are given, 43If no flags are given,
44.Fl DdelmnoprSx 44.Fl DdelmoprSx
45is assumed (that is, everything except 45is assumed (that is, everything except
46.Fl Fhvw ) . 46.Fl Fhvw ) .
47.Pp 47.Pp
48The options are as follows: 48The options are as follows:
49.Bl -tag -width xxxx -compact 49.Bl -tag -width xxxx -compact
50.It Fl D 50.It Fl D
51Warn about bad casing and architectures in the .Dt macro. 51Warn about bad casing and architectures in the .Dt macro.
52.It Fl d 52.It Fl d
53Warn about bad date strings (in the .Dd macro). 53Warn about bad date strings (in the .Dd macro).
54.It Fl e 54.It Fl e
55Warn about unsorted errors (for functions). 55Warn about unsorted errors (for functions).
56.It Fl F 56.It Fl F
57Delete whitespace at the end of input lines. 57Delete whitespace at the end of input lines.
58.It Fl h 58.It Fl h
59Display usage. 59Display usage.
60.It Fl l 60.It Fl l
61Warn about unknown libraries used as arguments to Lb. 61Warn about unknown libraries used as arguments to Lb.
62.It Fl m 62.It Fl m
63Warn if man page is not in 63Warn if man page is not in
64.Xr mdoc 7 64.Xr mdoc 7
65format. 65format.
66.It Fl n 
67Warn when the .Nd macro's argument ends in a dot, that is 
68.Sq \&. . 
69.It Fl o 66.It Fl o
70Warn when the .Os macro has an argument (it shouldn't have one at 67Warn when the .Os macro has an argument (it shouldn't have one at
71least in the base system, because on 68least in the base system, because on
72.Nx 69.Nx
73the current version is default). 70the current version is default).
74.It Fl p 71.It Fl p
75Warn about possible punctuation problems at the end of macro arguments, 72Warn about possible punctuation problems at the end of macro arguments,
76abuse of .Ns to get punctuation directly next to a word, 73abuse of .Ns to get punctuation directly next to a word,
77and sentences not starting on a new line. 74and sentences not starting on a new line.
78.It Fl r 75.It Fl r
79Warn about missing RCS Id. 76Warn about missing RCS Id.
80.It Fl S 77.It Fl S
81Warn about any unknown sections or about a section that comes in the 78Warn about any unknown sections or about a section that comes in the