Add mdoc style checker

Add a new make 'mancheck' target which uses mandoc -Tlint to verify
manpage files: currently only zfs(8), zpool(8) zdb(8) and zgenhostid(8)
are supported.

Additionally fix some outstanding manpage formatting issues.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #6646
This commit is contained in:
LOLi 2017-09-16 19:51:24 +02:00 committed by Brian Behlendorf
parent 1f4e2c88fd
commit 90cdf2833d
4 changed files with 31 additions and 26 deletions

View File

@ -39,7 +39,7 @@ dist-hook:
sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
$(distdir)/META $(distdir)/META
checkstyle: cstyle shellcheck flake8 commitcheck checkstyle: cstyle shellcheck flake8 commitcheck mancheck
commitcheck: commitcheck:
@if git rev-parse --git-dir > /dev/null 2>&1; then \ @if git rev-parse --git-dir > /dev/null 2>&1; then \
@ -58,6 +58,13 @@ shellcheck:
$$(find cmd/zpool/zpool.d/* -executable); \ $$(find cmd/zpool/zpool.d/* -executable); \
fi fi
mancheck:
@if type mandoc > /dev/null 2>&1; then \
for file in zfs zpool zdb zgenhostid; do \
mandoc -Tlint -Werror ${top_srcdir}/man/man8/$$file.8; \
done \
fi
lint: cppcheck paxcheck lint: cppcheck paxcheck
cppcheck: cppcheck:

View File

@ -64,7 +64,7 @@
.Nm .Nm
.Cm snapshot .Cm snapshot
.Op Fl r .Op Fl r
.Oo Fl o Ar property Ns = Ns value Oc Ns ... .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
.Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ... .Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
.Nm .Nm
.Cm rollback .Cm rollback
@ -2174,8 +2174,7 @@ Creating an encrypted dataset requires specifying the
and and
.Sy keyformat .Sy keyformat
properties at creation time, along with an optional properties at creation time, along with an optional
.Sy .Sy keylocation
keylocation
and and
.Sy pbkdf2iters . .Sy pbkdf2iters .
After entering an encryption key, the After entering an encryption key, the
@ -3443,9 +3442,9 @@ destroyed by using the
command. command.
.Pp .Pp
If If
.Sy Fl o Em property=value .Fl o Em property Ns = Ns Ar value
or or
.Sy Fl x Em property .Fl x Em property
is specified, it applies to the effective value of the property throughout is specified, it applies to the effective value of the property throughout
the entire subtree of replicated datasets. Effective property values will be the entire subtree of replicated datasets. Effective property values will be
set ( set (
@ -3458,7 +3457,7 @@ property to be inherited from the topmost file system. Received properties
are retained in spite of being overridden and may be restored with are retained in spite of being overridden and may be restored with
.Nm zfs Cm inherit Fl S . .Nm zfs Cm inherit Fl S .
Specifying Specifying
.Sy Fl o Em origin=snapshot .Fl o Sy origin Ns = Ns Em snapshot
is a special case because, even if is a special case because, even if
.Sy origin .Sy origin
is a read-only property and cannot be set, it's allowed to receive the send is a read-only property and cannot be set, it's allowed to receive the send
@ -3537,9 +3536,9 @@ Which snapshot was specified will not affect the success or failure of the
receive, as long as the snapshot does exist. receive, as long as the snapshot does exist.
If the stream is an incremental send stream, all the normal verification will be If the stream is an incremental send stream, all the normal verification will be
performed. performed.
.It Fl o Em property=value .It Fl o Em property Ns = Ns Ar value
Sets the specified property as if the command Sets the specified property as if the command
.Nm zfs Cm set Em property=value .Nm zfs Cm set Em property Ns = Ns Ar value
was invoked immediately before the receive. When receiving a stream from was invoked immediately before the receive. When receiving a stream from
.Nm zfs Cm send Fl R , .Nm zfs Cm send Fl R ,
causes the property to be inherited by all descendant datasets, as through causes the property to be inherited by all descendant datasets, as through
@ -4536,18 +4535,18 @@ command will be undone if the share is ever unshared (such as at a reboot etc).
.Sh INTERFACE STABILITY .Sh INTERFACE STABILITY
.Sy Committed . .Sy Committed .
.Sh SEE ALSO .Sh SEE ALSO
.Xr attr 1 ,
.Xr gzip 1 , .Xr gzip 1 ,
.Xr ssh 1 , .Xr ssh 1 ,
.Xr mount 8 ,
.Xr zpool 8 ,
.Xr selinux 8 ,
.Xr chmod 2 , .Xr chmod 2 ,
.Xr fsync 2 ,
.Xr stat 2 , .Xr stat 2 ,
.Xr write 2 , .Xr write 2 ,
.Xr fsync 2 ,
.Xr attr 1 ,
.Xr acl 5 , .Xr acl 5 ,
.Xr attributes 5 ,
.Xr exports 5 , .Xr exports 5 ,
.Xr exportfs 8 , .Xr exportfs 8 ,
.Xr mount 8 ,
.Xr net 8 , .Xr net 8 ,
.Xr attributes 5 .Xr selinux 8 ,
.Xr zpool 8

View File

@ -42,7 +42,6 @@ value to store.
This emulates the This emulates the
.Xr genhostid 1 .Xr genhostid 1
utility and is provided for use on systems which do not include the utility. utility and is provided for use on systems which do not include the utility.
.Pp
.Sh OPTIONS .Sh OPTIONS
.Op Ar hostid .Op Ar hostid
Specifies the value to be placed in Specifies the value to be placed in
@ -67,6 +66,6 @@ exactly 8 digits long.
.Ed .Ed
.El .El
.Sh SEE ALSO .Sh SEE ALSO
.Xr spl-module-parameters 5 ,
.Xr genhostid 1 , .Xr genhostid 1 ,
.Xr hostid 1 .Xr hostid 1 ,
.Xr spl-module-parameters 5

View File

@ -878,11 +878,11 @@ The pool name must begin with a letter, and can only contain
alphanumeric characters as well as underscore alphanumeric characters as well as underscore
.Pq Qq Sy _ , .Pq Qq Sy _ ,
dash dash
.Pq Qq Sy \&. , .Pq Qq Sy \&- ,
colon colon
.Pq Qq Sy \&: , .Pq Qq Sy \&: ,
space space
.Pq Qq Sy - , .Pq Qq Sy \&\ ,
and period and period
.Pq Qq Sy \&. . .Pq Qq Sy \&. .
The pool names The pool names
@ -1500,7 +1500,7 @@ If
is passed without a script name, it prints a list of all scripts. is passed without a script name, it prints a list of all scripts.
.Fl c .Fl c
also sets verbose mode also sets verbose mode
.No ( Ns Fl v Ns No ). .No \&( Ns Fl v Ns No \&).
.Pp .Pp
Script output should be in the form of "name=value". The column name is Script output should be in the form of "name=value". The column name is
set to "name" and the value is set to "value". Multiple lines can be set to "name" and the value is set to "value". Multiple lines can be
@ -1511,7 +1511,6 @@ messages. Blank or NULL values are printed as a '-' to make output
awk-able. awk-able.
.Pp .Pp
The following environment variables are set before running each script: The following environment variables are set before running each script:
.Pp
.Bl -tag -width "VDEV_PATH" .Bl -tag -width "VDEV_PATH"
.It Sy VDEV_PATH .It Sy VDEV_PATH
Full path to the vdev Full path to the vdev
@ -2289,7 +2288,7 @@ option.
Cause Cause
.Nm zpool .Nm zpool
to dump core on exit for the purposes of running to dump core on exit for the purposes of running
.Sy::findleaks . .Sy ::findleaks .
.El .El
.Bl -tag -width "ZPOOL_IMPORT_PATH" .Bl -tag -width "ZPOOL_IMPORT_PATH"
.It Ev ZPOOL_IMPORT_PATH .It Ev ZPOOL_IMPORT_PATH
@ -2380,11 +2379,12 @@ option. If
.Sy ZPOOL_SCRIPTS_ENABLED .Sy ZPOOL_SCRIPTS_ENABLED
is not set, it is assumed that the user is allowed to run is not set, it is assumed that the user is allowed to run
.Nm zpool status/iostat -c . .Nm zpool status/iostat -c .
.El
.Sh INTERFACE STABILITY .Sh INTERFACE STABILITY
.Sy Evolving .Sy Evolving
.Sh SEE ALSO .Sh SEE ALSO
.Xr zed 8 ,
.Xr zfs 8 ,
.Xr zfs-events 5 , .Xr zfs-events 5 ,
.Xr zfs-module-parameters 5 , .Xr zfs-module-parameters 5 ,
.Xr zpool-features 5 .Xr zpool-features 5 ,
.Xr zed 8 ,
.Xr zfs 8