Skip to contentSkip to conversation

dash: man pages: fix formatting

PATCH New Bjarni Ingi Gislason 1 participant 1 message Jun 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dash: man pages: fix formatting

Fix formatting according to the output of "mandoc -Tlint".

Overview:

Start each sentence on a new line.

Protect a punctuation mark in a macro call with '\&'.

Trim trailing space.

Add a missing comma in a row of words.

Use an en-dash instead of '--' if there is space around it. An em-dash is used without space around it.

Comment out ".Pp" macros that do nothing.

Split long sentences after a punctuation mark.

Remove a "-width ..." for a ".Bl -item" macro, as it has no influence

Details:

mandoc: ./src/bltin/echo.1:69:38: WARNING: new sentence, new line
mandoc: ./src/bltin/echo.1:75:35: WARNING: new sentence, new line
mandoc: ./src/bltin/printf.1:205:12: WARNING: skipping empty macro: No
mandoc: ./src/bltin/printf.1:284:28: STYLE: whitespace at end of input line
mandoc: ./src/bltin/printf.1:288:20: STYLE: whitespace at end of input line
mandoc: ./src/bltin/printf.1:293:28: STYLE: whitespace at end of input line
mandoc: ./src/bltin/printf.1:353:31: WARNING: new sentence, new line
mandoc: ./src/bltin/printf.1:74:2: STYLE: useless macro: Tn
mandoc: ./src/bltin/printf.1:111:2: STYLE: useless macro: Tn
mandoc: ./src/bltin/printf.1:116:2: STYLE: useless macro: Tn
mandoc: ./src/bltin/printf.1:279:2: STYLE: useless macro: Tn
mandoc: ./src/bltin/printf.1:334:2: WARNING: unusual Xr punctuation: none before vis(3)
mandoc: ./src/bltin/printf.1:334:2: WARNING: unusual Xr order: vis(3) after printf(9)
mandoc: ./src/bltin/printf.1:348:2: STYLE: useless macro: Tn
mandoc: ./src/bltin/printf.1:333:6: STYLE: referenced manual not found: Xr printf 9
mandoc: ./src/bltin/printf.1:334:6: STYLE: referenced manual not found: Xr vis 3
mandoc: ./src/bltin/test.1:46:16: WARNING: skipping empty macro: Cm
mandoc: ./src/bltin/test.1:105:5: STYLE: useless macro: Tn
mandoc: ./src/dash.1:1180:58: WARNING: new sentence, new line
mandoc: ./src/dash.1:1186:13: STYLE: whitespace at end of input line
mandoc: ./src/dash.1:1194:38: WARNING: new sentence, new line
mandoc: ./src/dash.1:1200:35: WARNING: new sentence, new line
mandoc: ./src/dash.1:1474:71: WARNING: new sentence, new line
mandoc: ./src/dash.1:1783:62: WARNING: new sentence, new line
mandoc: ./src/dash.1:2061:22: WARNING: new sentence, new line
mandoc: ./src/dash.1:2311:54: WARNING: new sentence, new line
mandoc: ./src/dash.1:2315:63: WARNING: new sentence, new line
mandoc: ./src/dash.1:37:2: WARNING: prologue macros out of order: Dt after Os
mandoc: ./src/dash.1:87:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:94:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:343:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:442:17: STYLE: verbatim "--", maybe consider using \(em
mandoc: ./src/dash.1:466:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:581:34: STYLE: verbatim "--", maybe consider using \(em
mandoc: ./src/dash.1:583:25: STYLE: verbatim "--", maybe consider using \(em
mandoc: ./src/dash.1:585:43: STYLE: verbatim "--", maybe consider using \(em
mandoc: ./src/dash.1:595:11: STYLE: verbatim "--", maybe consider using \(em
mandoc: ./src/dash.1:618:29: STYLE: verbatim "--", maybe consider using \(em
mandoc: ./src/dash.1:697:2: WARNING: skipping paragraph macro: Pp before Bd
mandoc: ./src/dash.1:1344:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:1420:2: WARNING: skipping paragraph macro: Pp before Bd
mandoc: ./src/dash.1:1434:2: WARNING: skipping paragraph macro: Pp before Bd
mandoc: ./src/dash.1:1556:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:1587:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:1746:2: STYLE: useless macro: Tn
mandoc: ./src/dash.1:1875:5: STYLE: useless macro: Tn
mandoc: ./src/dash.1:1525:2: WARNING: skipping paragraph macro: Pp before It
mandoc: ./src/dash.1:2182:2: WARNING: skipping paragraph macro: Pp before It
mandoc: ./src/dash.1:2247:2: WARNING: sections out of conventional order: Sh ENVIRONMENT
mandoc: ./src/dash.1:2323:11: WARNING: skipping -width argument: Bl -item
mandoc: ./src/dash.1:2347:31: STYLE: consider using OS macro: Nx
mandoc: ./src/dash.1:92:6: STYLE: referenced manual not found: Xr ksh 1 (2 times)
mandoc: ./src/dash.1:253:6: STYLE: referenced manual not found: Xr emacs 1
mandoc: ./src/dash.1:2253:9: STYLE: referenced manual not found: Xr passwd 4
mandoc: ./src/dash.1:2330:6: STYLE: referenced manual not found: Xr csh 1

---
 src/bltin/echo.1   |  6 +++--
 src/bltin/printf.1 | 13 ++++++-----
 src/bltin/test.1   |  2 +-
 src/dash.1         | 57 +++++++++++++++++++++++++++-------------------
 4 files changed, 45 insertions(+), 33 deletions(-)
src/bltin/echo.1 +4 -2
index fbc7fb4..4d1890f 100644
@@ -66,13 +66,15 @@ and
 may be given.
 .Pp
 If any of the following sequences of characters is encountered during
-output, the sequence is not output.  Instead, the specified action is
+output, the sequence is not output.
+Instead, the specified action is
 performed:
 .Bl -tag -width indent
 .It Li \eb
 A backspace character is output.
 .It Li \ec
-Subsequent output is suppressed.  This is normally used at the end of the
+Subsequent output is suppressed.
+This is normally used at the end of the
 last argument to suppress the trailing newline that
 .Nm
 would otherwise output.
src/bltin/printf.1 +7 -6
index 3873173..409d434 100644
@@ -202,7 +202,7 @@ and
 formats, or the maximum number of characters to be printed
 from a string
 .Sm off
-.Pf ( Cm b No ,
+.Pf ( Cm b Ns \&,
 .Sm on
 .Cm B
 and
@@ -281,16 +281,16 @@ value is the 1\-, 2\-, or 3\-digit
 octal number
 .Ar num .
 .It Cm \e^ Ns Ar c
-Write the control character 
+Write the control character
 .Ar c .
 Generates characters `\e000' through `\e037`, and `\e177' (from `\e^?').
 .It Cm \eM\- Ns Ar c
-Write the character 
+Write the character
 .Ar c
 with the 8th bit set.
 Generates characters `\e241' through `\e376`.
 .It Cm \eM^ Ns Ar c
-Write the control character 
+Write the control character
 .Ar c
 with the 8th bit set.
 Generates characters `\e000' through `\e037`, and `\e177' (from `\eM^?').
@@ -330,7 +330,7 @@ exits 0 on success, 1 on failure.
 .Sh SEE ALSO
 .Xr echo 1 ,
 .Xr printf 3 ,
-.Xr printf 9
+.Xr printf 9 ,
 .Xr vis 3
 .Sh STANDARDS
 The
@@ -350,5 +350,6 @@ to floating-point and
 then back again, floating-point precision may be lost.
 .Pp
 Hexadecimal character constants are restricted to, and should be specified
-as, two character constants.  This is contrary to the ISO C standard but
+as, two character constants.
+This is contrary to the ISO C standard but
 does guarantee detection of the end of the constant.
src/bltin/test.1 +1 -1
index 42435fb..03abce8 100644
@@ -43,7 +43,7 @@
 .Nm test
 .Ar expression
 .Nm \&[
-.Ar expression Cm ]
+.Ar expression Cm \&]
 .Sh DESCRIPTION
 The
 .Nm test
src/dash.1 +33 -24

175 lines not on this page · raw message

Signature · 1 line
2.27.0