Bug#1112647: Lintian::Tutorial::WritingChecks.3: Some remarks and a patch with editorial changes for this man page
Package: lintian
Version: 2.123.0
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with a new version
test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"
[Use
grep -n -e ' $' -e '\\~$' -e ' \\f.$' -e ' \\"' <file>
to find (most) trailing spaces.]
["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).
[The fate of "test-nroff" was decided in groff bug #55941.]
* What was the outcome of this action?
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=0 -ww -z ":
troff:<stdin>:103: warning: trailing space in the line
troff:<stdin>:239: warning: trailing space in the line
troff:<stdin>:357: warning: trailing space in the line
troff:<stdin>:439: warning: trailing space in the line
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material, if a diff-file exist, are in the
attachments.
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.16.3+deb14-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages lintian depends on:
ii appstream 1.0.6-2
ii binutils 2.45-4
ii bzip2 1.0.8-6
ii diffstat 1.67-1
ii dpkg 1.22.21
ii dpkg-dev 1.22.21
ii file 1:5.46-5
ii gettext 0.23.1-2+b1
ii gpg 2.4.8-3
ii intltool-debian 0.35.0+20060710.6
ii iso-codes 4.18.0-1
ii libapt-pkg-perl 0.1.42
ii libarchive-zip-perl 1.68-1
ii libberkeleydb-perl 0.66-1
ii libcapture-tiny-perl 0.50-1
ii libclass-xsaccessor-perl 1.19-4+b5
ii libclone-perl 0.47-1+b1
ii libconfig-tiny-perl 2.30-1
ii libconst-fast-perl 0.014-2
ii libcpanel-json-xs-perl 4.39-1
ii libdata-dpath-perl 0.60-1
ii libdata-validate-domain-perl 0.15-1
ii libdata-validate-uri-perl 0.07-3
ii libdevel-size-perl 0.85-1
pn libdigest-sha-perl <none>
ii libdpkg-perl 1.22.21
ii libemail-address-xs-perl 1.05-1+b4
pn libencode-perl <none>
ii libfile-basedir-perl 0.09-2
ii libfile-find-rule-perl 0.34-4
ii libfont-ttf-perl 1.06-2
ii libhtml-html5-entities-perl 0.004-3
ii libhtml-tokeparser-simple-perl 3.16-4
ii libio-interactive-perl 1.027-1
ii libipc-run3-perl 0.049-1
ii libjson-maybexs-perl 1.004008-1
ii liblist-compare-perl 0.55-2
ii liblist-someutils-perl 0.59-1
ii liblist-utilsby-perl 0.12-2
ii libmldbm-perl 2.05-4
ii libmoo-perl 2.005005-1
ii libmoox-aliases-perl 0.001006-2
ii libnamespace-clean-perl 0.27-2
ii libpath-tiny-perl 0.148-1
ii libperlio-gzip-perl 0.20-1+b4
ii libperlio-utf8-strict-perl 0.010-1+b3
ii libproc-processtable-perl 0.637-1
ii libregexp-wildcards-perl 1.05-3
ii libsereal-decoder-perl 5.004+ds-1+b3
ii libsereal-encoder-perl 5.004+ds-1+b3
ii libsort-versions-perl 1.62-3
ii libsyntax-keyword-try-perl 0.30-1+b1
ii libterm-readkey-perl 2.38-2+b4
ii libtext-levenshteinxs-perl 0.03-5+b4
ii libtext-markdown-discount-perl 0.18-1
ii libtext-xslate-perl 3.5.9-2+b1
ii libtime-duration-perl 1.21-2
ii libtime-moment-perl 0.44-2+b4
ii libtimedate-perl 2.3300-2
ii libunicode-utf8-perl 0.62-3
ii liburi-perl 5.30-1
ii libwww-mechanize-perl 2.19-1
ii libwww-perl 6.78-1
ii libxml-libxml-perl 2.0207+dfsg+really+2.0134-6
ii libyaml-libyaml-perl 0.903.0+ds-1
ii lzip [lzip-decompressor] 1.25-3
ii lzop 1.04-2
ii man-db 2.13.1-1
ii patchutils 0.4.2-1
ii perl [libversion-perl] 5.40.1-6
ii t1utils 1.41-4
ii unzip 6.0-29
ii xz-utils 5.8.1-1
lintian recommends no packages.
Versions of packages lintian suggests:
pn binutils-multiarch <none>
pn libtext-template-perl <none>
-- no debconf information
Input file is Lintian::Tutorial::WritingChecks.3
Output from "mandoc -T lint Lintian::Tutorial::WritingChecks.3": (shortened list)
2 STYLE: input text line longer than 80 bytes:
-.-.
Output from
test-nroff -mandoc -t -ww -z Lintian::Tutorial::WritingChecks.3: (shortened list)
4 line(s) with a trailing space
Find most trailing spaces with:
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>
-.-.
Input file is Lintian::Tutorial::WritingChecks.3
Show if Pod::Man generated this.
2:.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
Latest version in Debian testing:
This is perl 5, version 40, subversion 1 (v5.40.1) built for x86_64-linux-gnu-thread-multi
(with 48 registered patches, see perl -V for more detail)
-.-.
Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".
Number of lines affected is
4
-.-.
Reduce space between words.
Lintian::Tutorial::WritingChecks.3:21:. ds C` ""
Lintian::Tutorial::WritingChecks.3:22:. ds C' ""
Lintian::Tutorial::WritingChecks.3:25:. ds C`
Lintian::Tutorial::WritingChecks.3:26:. ds C'
Lintian::Tutorial::WritingChecks.3:31:.el .ds Aq '
Lintian::Tutorial::WritingChecks.3:44:. if \nF \{\
Lintian::Tutorial::WritingChecks.3:45:. de IX
Lintian::Tutorial::WritingChecks.3:46:. tm Index:\\$1\t\\n%\t"\\$2"
Lintian::Tutorial::WritingChecks.3:48:. if !\nF==2 \{\
Lintian::Tutorial::WritingChecks.3:49:. nr % 0
Lintian::Tutorial::WritingChecks.3:50:. nr F 2
Lintian::Tutorial::WritingChecks.3:51:. \}
Lintian::Tutorial::WritingChecks.3:52:. \}
Lintian::Tutorial::WritingChecks.3:73:\& checks/<my\-check>.pm
Lintian::Tutorial::WritingChecks.3:74:\& checks/<my\-check>.desc
Lintian::Tutorial::WritingChecks.3:105:\& my ($pkg, $type, $info, $proc, $group) = @_;
Lintian::Tutorial::WritingChecks.3:106:\& return;
Lintian::Tutorial::WritingChecks.3:241:\& Lintian::Data\->new(\*(Aqdeb/pkg\-check/multiarch\-values\*(Aq);
Lintian::Tutorial::WritingChecks.3:276:\& unless exists $VALID_MULTI_ARCH_VALUES{$multiarch};
Lintian::Tutorial::WritingChecks.3:282:\& unless $VALID_MULTI_ARCH_VALUES\->known($multiarch);
Lintian::Tutorial::WritingChecks.3:300:\& foreach my $elem ($dir\->children) {
Lintian::Tutorial::WritingChecks.3:301:\& print $elem\->name . " is a file" if $elem\->is_file;
Lintian::Tutorial::WritingChecks.3:302:\& # ...
Lintian::Tutorial::WritingChecks.3:303:\& }
Lintian::Tutorial::WritingChecks.3:364:\& # a file and contained within the package root.
Lintian::Tutorial::WritingChecks.3:366:\& # not a file or an unsafe path
Lintian::Tutorial::WritingChecks.3:376:\& Needs\-Info requirements for using methodx: Y
Lintian::Tutorial::WritingChecks.3:407:package! An example of this "changelog", which requires "changelog-file"
Lintian::Tutorial::WritingChecks.3:443:\& # Looks safe, but isn\*(Aqt in general
Lintian::Tutorial::WritingChecks.3:444:\& open(my $fd, \*(Aq<\*(Aq, $ufile);
Lintian::Tutorial::WritingChecks.3:445:\& ...;
Lintian::Tutorial::WritingChecks.3:462:\& # $ufile is a file and it is contained within the package root.
Lintian::Tutorial::WritingChecks.3:463:\& open(m $fd, \*(Aq<\*(Aq, $ufile);
Lintian::Tutorial::WritingChecks.3:464:\& ...;
Lintian::Tutorial::WritingChecks.3:477:\& my $fd = $ufile\->open;
Lintian::Tutorial::WritingChecks.3:478:\& ...;
-.-.
Add a "\&" (or a comma (Oxford comma)) after an abbreviation
or use English words
(man-pages(7)).
Abbreviation points should be marked as such and protected against being
interpreted as an end of sentence, if they are not, and that independent
of the current place on the line.
180:in all lowercase letters (i.e. use "multi-arch", not "Multi-Arch").
194:uses \fIpure\fR logic to determine if dependencies are satisfied (i.e. it
205:one relation "implies" another (i.e. if you satisfied relationA then
218:"tables" via Lintian::Data (i.e. "unordered" collections). As an
253:"all" (i.e. \f(CW$data\fR\->all) returns a list of all the entries in the data
258:"known" (i.e. \f(CW$data\fR\->known('item')) returns a truth value if a given
264:"value" (i.e. \f(CW$data\fR\->value('key')) returns a value associated with a
321:an object returned by e.g.
338:that it is not (e.g.) a named pipe or such.
400:The element is the name of a collection (e.g. "control_index").
403:use (e.g.) control_index,
-.-.
Wrong distance (not two spaces) between sentences in the input file.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
Mark a final abbreviation point as such by suffixing it with "\&".
Some sentences (etc.) do not begin on a new line.
Split (sometimes) lines after a punctuation mark; before a conjunction.
Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.
Use
#!/usr/bin/sh
sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\. */\1.\n/g' $1
to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"
[List of affected lines removed.]
180:in all lowercase letters (i.e. use "multi-arch", not "Multi-Arch").
194:uses \fIpure\fR logic to determine if dependencies are satisfied (i.e. it
205:one relation "implies" another (i.e. if you satisfied relationA then
218:"tables" via Lintian::Data (i.e. "unordered" collections). As an
253:"all" (i.e. \f(CW$data\fR\->all) returns a list of all the entries in the data
258:"known" (i.e. \f(CW$data\fR\->known('item')) returns a truth value if a given
264:"value" (i.e. \f(CW$data\fR\->value('key')) returns a value associated with a
301:\& print $elem\->name . " is a file" if $elem\->is_file;
338:that it is not (e.g.) a named pipe or such.
400:The element is the name of a collection (e.g. "control_index").
403:use (e.g.) control_index,
442:\& if ( ! \-l $ufile) {
461:\& if ( ! \-l $ufile && \-f $ufile && is_ancestor_of($info\->unpacked, $ufile)) {
468:In some cases you can even drop the "! \-l \f(CW$ufile\fR" part.
-.-.
Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.
Line 209, length 89
lowercase. However "relation" will never return \f(CW\*(C`undef\*(C'\fR (not even if the
Line 265, length 84
key for key/value tables. For unknown keys, it returns \f(CW\*(C`undef\*(C'\fR. If
Line 363, length 81
\& if ( \-f $unpacked_file && is_ancestor_of($info\->unpacked, $unpacked_file)) {
Line 461, length 81
\& if ( ! \-l $ufile && \-f $ufile && is_ancestor_of($info\->unpacked, $ufile)) {
-.-.
Add a zero (0) in front of a decimal fraction that begins with a period
(.)
7:.if t .sp .5v
-.-.
Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".
[List of affected lines removed.]
-.-.
Use a character "\(->" instead of plain "->" or "\->".
122:(Same as \f(CW$proc\fR\->pkg_name)
135:(Current it is always identical to \f(CW$proc\fR\->pkg_type)
151:(Currently it is the same as \f(CW$proc\fR\->info)
199:\&\f(CW$info\fR\->relation method for
202:\&\f(CW$info\fR\->relation returns an instance of Lintian::Relation. This
241:\& Lintian::Data\->new(\*(Aqdeb/pkg\-check/multiarch\-values\*(Aq);
253:"all" (i.e. \f(CW$data\fR\->all) returns a list of all the entries in the data
258:"known" (i.e. \f(CW$data\fR\->known('item')) returns a truth value if a given
264:"value" (i.e. \f(CW$data\fR\->value('key')) returns a value associated with a
282:\& unless $VALID_MULTI_ARCH_VALUES\->known($multiarch);
288:\&\f(CW$info\fR\->index and
289:\&\f(CW$info\fR\->sorted_index methods
299:\& if (my $dir = $info\->index(\*(Aqpath/to/dir/\*(Aq)) {
300:\& foreach my $elem ($dir\->children) {
301:\& print $elem\->name . " is a file" if $elem\->is_file;
313:\&\f(CW$info\fR\->control_index and
314:\&\f(CW$info\fR\->sorted_control_index.
322:\&\f(CW$info\fR\->index. These
359:\& # The snippet applies equally well to $info\->debfiles and
360:\& # $info\->control (just remember to subst all occurrences of
361:\& # $info\->unpacked).
362:\& my $unpacked_file = $info\->unpacked($path);
363:\& if ( \-f $unpacked_file && is_ancestor_of($info\->unpacked, $unpacked_file)) {
441:\& my $ufile = $info\->unpacked($filename);
460:\& my $ufile = $info\->unpacked($filename);
461:\& if ( ! \-l $ufile && \-f $ufile && is_ancestor_of($info\->unpacked, $ufile)) {
475:\& my $ufile = $info\->index($filename);
476:\& if ( $ufile && $ufile\->is_file && $ufile\->is_open_ok) {
477:\& my $fd = $ufile\->open;
482:Here you can drop the " && \f(CW$ufile\fR\->is_file" if you want to permit
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=0 -ww -z ":
troff:<stdin>:103: warning: trailing space in the line
troff:<stdin>:239: warning: trailing space in the line
troff:<stdin>:357: warning: trailing space in the line
troff:<stdin>:439: warning: trailing space in the line
-.-
Generally:
Split (sometimes) lines after a punctuation mark; before a conjunction.
--- Lintian::Tutorial::WritingChecks.3 2025-08-31 13:51:40.007712819 +0000
+++ Lintian::Tutorial::WritingChecks.3.new 2025-08-31 14:12:33.336741538 +0000
@@ -100,7 +100,7 @@ Start with the template:
\&
\& use strict;
\& use warnings;
-\&
+\&
\& sub run {
\& my ($pkg, $type, $info, $proc, $group) = @_;
\& return;
@@ -236,7 +236,7 @@ Now we can load it by using:
.PP
.Vb 1
\& use Lintian::Data;
-\&
+\&
\& my $VALID_MULTI_ARCH_VALUES =
\& Lintian::Data\->new(\*(Aqdeb/pkg\-check/multiarch\-values\*(Aq);
.Ve
@@ -354,7 +354,7 @@ not escape the root.
.PP
.Vb 1
\& use Lintian::Util qw(is_ancestor_of);
-\&
+\&
\& my $path = ...;
\& # The snippet applies equally well to $info\->debfiles and
\& # $info\->control (just remember to subst all occurrences of
@@ -436,7 +436,7 @@ You might be tempted to think that the f
.Sp
.Vb 1
\& use autodie;
-\&
+\&
\& my $filename = \*(Aqsome/file\*(Aq;
\& my $ufile = $info\->unpacked($filename);
\& if ( ! \-l $ufile) {
Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)
[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>
To find trailing space use
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>
The same goes for man pages that are used as an input.
-.-
For a style guide use
mandoc -T lint
-.-
For general input conventions consult the man page "nroff(7)" (item
"Input conventions") or the Texinfo manual about the same item.
-.-
Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
It should also check its input files for too long (> 80) lines.
This is just a simple quality control measure.
The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
"git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")
Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.
The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.
See man-pages(7), item "semantic newline".
-.-
The difference between the formatted output of the original
and patched file can be seen with:
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -d -u <out1> <out2>
and for groff, using
\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"
instead of 'nroff -mandoc'
Add the option '-t', if the file contains a table.
Read the output from 'diff -d -u ...' with 'less -R' or similar.
-.-.
If 'man' (man-db) is used to check the manual for warnings,
the following must be set:
The option "-warnings=w"
The environmental variable:
export MAN_KEEP_STDERR=yes (or any non-empty value)
or
(produce only warnings):
export MANROFFOPT="-ww -b -z"
export MAN_KEEP_STDERR=yes (or any non-empty value)
-.-
Reply to: