Bug#1102263: Class::Inspector.3pm: Some remarks and a patch with editorial changes for this man page

Bjarni Ingi Gislason bjarniig at simnet.is
Sun Apr 6 21:55:57 BST 2025


Package: libclass-inspector-perl
Version: 1.36-3
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?

troff:<stdin>:88: warning: trailing space in the line
troff:<stdin>:92: warning: trailing space in the line
troff:<stdin>:96: warning: trailing space in the line
troff:<stdin>:102: warning: trailing space in the line


Bad use of \s0 in a string definition, the string "X" could be resized,
for example with "\s-1\*X\s0".


25:.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'


   * 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: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.21-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 libclass-inspector-perl depends on:
ii  perl  5.40.1-2

libclass-inspector-perl recommends no packages.

libclass-inspector-perl suggests no packages.

-- no debconf information
-------------- next part --------------
Input file is Class::Inspector.3pm

Output from "mandoc -T lint  Class::Inspector.3pm": (shortened list)

      1 : Class::Inspector.3pm:121:88: STYLE: input text line longer than 80 bytes: The \f(CW\*(C`instal...
[...]
[...]
      1 : Class::Inspector.3pm:312:87: STYLE: input text line longer than 80 bytes: provided, or false i...

-.-.

Output from
test-nroff -mandoc -t -ww -z Class::Inspector.3pm: (shortened list)

      4 line(s) with a trailing space


Find trailing space with:
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

-.-.

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

-.-.

Change '-' (\-) to '\(en' (en-dash) for a (numeric) range.

GNU gnulib has recently (2023-06-18) updated its
"build_aux/update-copyright" to recognize "\(en" in man pages.

Class::Inspector.3pm:332:This software is copyright (c) 2002\-2019 by Adam Kennedy.

-.-.

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.

309:method. (i.e. \f(CW\*(C`My::Class\->isa($class)\*(C'\fR.

-.-.

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"

108:Class::Inspector allows you to get information about a loaded class. Most or
111:or strange and unusual looking code. Class::Inspector attempts to provide
122:on the machine, or at least available to Perl. It does this by wrapping
138:classes in it. Even in the case of some sort of run-time loading class
151:For a given class, returns the base filename for the class. This will \s-1NOT\s0
172:resolved filename for a class. That is, the file that the class would be
231:Note that this is as a function, not as a method. To see if a method
243:the methods available to that class. This includes all methods available
251:the results returned. These should be listed after the class name, in any
261:convention of prepending an underscore to any 'private' methods. The \f(CW\*(C`public\*(C'\fR
266:Perl convention of prepending an underscore to an private methods. The
273:\&\f(CW\*(C`methods\*(C'\fR normally returns just the method name. Supplying the \f(CW\*(C`full\*(C'\fR option
274:will cause the methods to be returned as the full names. That is, instead of
280:returned. Instead of just the method name, you will instead get an array
283:available ). Please note that the function reference is not guaranteed to
284:be available. \f(CW\*(C`Class::Inspector\*(C'\fR is intended at some later time, to work
309:method. (i.e. \f(CW\*(C`My::Class\->isa($class)\*(C'\fR.

-.-.

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.  

[List of affected lines removed.]

Longest line is number 273 with 110 characters
\&\f(CW\*(C`methods\*(C'\fR normally returns just the method name. Supplying the \f(CW\*(C`full\*(C'\fR option

-.-.

Do not use "\s0" in a string definition but an absolute number,
as the size of the string could be changed.
Then a situation of "\s+X...\s+Y...\s0...\s0" could emerge.
Type size changes have an effect in "troff", but not in "nroff".

25:.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'

-.-.

Add a zero (0) in front of a decimal fraction that begins with a period
(.)

6:.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 "\->".

90:\&  Class::Inspector\->installed( \*(AqFoo::Class\*(Aq );
91:\&  Class::Inspector\->loaded( \*(AqFoo::Class\*(Aq );
94:\&  Class::Inspector\->filename( \*(AqFoo::Class\*(Aq );
95:\&  Class::Inspector\->resolved_filename( \*(AqFoo::Class\*(Aq );
98:\&  Class::Inspector\->functions( \*(AqFoo::Class\*(Aq );
99:\&  Class::Inspector\->function_refs( \*(AqFoo::Class\*(Aq );
100:\&  Class::Inspector\->function_exists( \*(AqFoo::Class\*(Aq, \*(Aqbar\*(Aq );
101:\&  Class::Inspector\->methods( \*(AqFoo::Class\*(Aq, \*(Aqfull\*(Aq, \*(Aqpublic\*(Aq );
104:\&  Class::Inspector\->subclasses( \*(AqFoo::Class\*(Aq );
118:\& my $bool = Class::Inspector\->installed($class);
130:\& my $bool = Class::Inspector\->loaded($class);
148:\& my $filename = Class::Inspector\->filename($class);
156:\&  print Class\->filename( \*(AqFoo::Bar\*(Aq );
167:\& my $filename = Class::Inspector\->resolved_filename($class);
168:\& my $filename = Class::Inspector\->resolved_filename($class, @try_first);
187:\& my $filename = Class::Inspector\->loaded_filename($class);
199:\& my $arrayref = Class::Inspector\->functions($class);
212:\& my $arrayref = Class::Inspector\->function_refs($class);
225:\& my $bool = Class::Inspector\->function_exists($class, $functon);
239:\& my $arrayref = Class::Inspector\->methods($class, @options);
256:\&  my $method = Class::Inspector\->methods( \*(AqMy::Class\*(Aq, \*(Aqpublic\*(Aq );
301:\& my $arrayref = Class::Inspector\->subclasses($class);
309:method. (i.e. \f(CW\*(C`My::Class\->isa($class)\*(C'\fR.

-.-.

Add missing period (.) for "e.g"

285:with modules that have some kind of common run-time loader in place ( e.g

-.-.

Only one space character is after a possible end of sentence
(after a punctuation, that can end a sentence).

Class::Inspector.3pm:108:Class::Inspector allows you to get information about a loaded class. Most or
Class::Inspector.3pm:111:or strange and unusual looking code. Class::Inspector attempts to provide
Class::Inspector.3pm:122:on the machine, or at least available to Perl. It does this by wrapping
Class::Inspector.3pm:138:classes in it. Even in the case of some sort of run-time loading class
Class::Inspector.3pm:151:For a given class, returns the base filename for the class. This will \s-1NOT\s0
Class::Inspector.3pm:172:resolved filename for a class. That is, the file that the class would be
Class::Inspector.3pm:231:Note that this is as a function, not as a method. To see if a method
Class::Inspector.3pm:243:the methods available to that class. This includes all methods available
Class::Inspector.3pm:251:the results returned. These should be listed after the class name, in any
Class::Inspector.3pm:261:convention of prepending an underscore to any 'private' methods. The \f(CW\*(C`public\*(C'\fR
Class::Inspector.3pm:266:Perl convention of prepending an underscore to an private methods. The
Class::Inspector.3pm:273:\&\f(CW\*(C`methods\*(C'\fR normally returns just the method name. Supplying the \f(CW\*(C`full\*(C'\fR option
Class::Inspector.3pm:274:will cause the methods to be returned as the full names. That is, instead of
Class::Inspector.3pm:280:returned. Instead of just the method name, you will instead get an array
Class::Inspector.3pm:283:available ). Please note that the function reference is not guaranteed to
Class::Inspector.3pm:284:be available. \f(CW\*(C`Class::Inspector\*(C'\fR is intended at some later time, to work
Class::Inspector.3pm:309:method. (i.e. \f(CW\*(C`My::Class\->isa($class)\*(C'\fR.

-.-.

Put a subordinate sentence (after a comma) on a new line.

[List of affected lines removed.]

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

Class::Inspector.3pm:74:.TH Class::Inspector 3pm "2022-10-21" "perl v5.34.0" "User Contributed Perl Documentation"
Class::Inspector.3pm:79:.SH "NAME"
Class::Inspector.3pm:81:.SH "VERSION"
Class::Inspector.3pm:82:.IX Header "VERSION"
Class::Inspector.3pm:84:.SH "SYNOPSIS"
Class::Inspector.3pm:85:.IX Header "SYNOPSIS"
Class::Inspector.3pm:106:.SH "DESCRIPTION"
Class::Inspector.3pm:107:.IX Header "DESCRIPTION"
Class::Inspector.3pm:113:.SH "METHODS"
Class::Inspector.3pm:114:.IX Header "METHODS"
Class::Inspector.3pm:115:.SS "installed"
Class::Inspector.3pm:116:.IX Subsection "installed"
Class::Inspector.3pm:127:.SS "loaded"
Class::Inspector.3pm:128:.IX Subsection "loaded"
Class::Inspector.3pm:145:.SS "filename"
Class::Inspector.3pm:146:.IX Subsection "filename"
Class::Inspector.3pm:164:.SS "resolved_filename"
Class::Inspector.3pm:165:.IX Subsection "resolved_filename"
Class::Inspector.3pm:184:.SS "loaded_filename"
Class::Inspector.3pm:185:.IX Subsection "loaded_filename"
Class::Inspector.3pm:196:.SS "functions"
Class::Inspector.3pm:197:.IX Subsection "functions"
Class::Inspector.3pm:209:.SS "function_refs"
Class::Inspector.3pm:210:.IX Subsection "function_refs"
Class::Inspector.3pm:222:.SS "function_exists"
Class::Inspector.3pm:223:.IX Subsection "function_exists"
Class::Inspector.3pm:236:.SS "methods"
Class::Inspector.3pm:237:.IX Subsection "methods"
Class::Inspector.3pm:258:.IP "public" 4
Class::Inspector.3pm:262:.IP "private" 4
Class::Inspector.3pm:269:.IP "full" 4
Class::Inspector.3pm:274:.IP "expanded" 4
Class::Inspector.3pm:294:.SS "subclasses"
Class::Inspector.3pm:295:.IX Subsection "subclasses"
Class::Inspector.3pm:313:.SH "AUTHOR"
Class::Inspector.3pm:314:.IX Header "AUTHOR"

-.-.

Use ".na" (no adjustment) instead of ".ad l" (and ".ad" to begin the
same adjustment again as before).

77:.if n .ad l

-.-.

Add lines to use the CR font for groff instead of CW.

.if t \{\
.  ie \\n(.g .ft CR
.  el .ft CW
.\}


10:.ft CW

-.-.

Section headings (.SH and .SS) do not need quoting their arguments.

79:.SH "NAME"
81:.SH "VERSION"
84:.SH "SYNOPSIS"
106:.SH "DESCRIPTION"
113:.SH "METHODS"
115:.SS "installed"
127:.SS "loaded"
145:.SS "filename"
164:.SS "resolved_filename"
184:.SS "loaded_filename"
196:.SS "functions"
209:.SS "function_refs"
222:.SS "function_exists"
236:.SS "methods"
298:.SS "subclasses"
314:.SH "SEE ALSO"
317:.SH "AUTHOR"
330:.SH "COPYRIGHT AND LICENSE"

-.-.

.\" Define a fallback for font CW with

.if t \{\
.  ie \n(.g .ds fC \f(CR
.  el .ds fC \f(CW
.\}
.
.if n \{\
.  ds fC \fR
.\}

Change \f(CW to \*(fC

[List of affected lines removed.]

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

troff:<stdin>:88: warning: trailing space in the line
troff:<stdin>:92: warning: trailing space in the line
troff:<stdin>:96: warning: trailing space in the line
troff:<stdin>:102: warning: trailing space in the line

Bad use of \s0 in a string definition, the string "X" could be resized,
for example with "\s-1\*X\s0".

25:.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
-------------- next part --------------
--- Class::Inspector.3pm	2025-04-06 20:39:18.902068944 +0000
+++ Class::Inspector.3pm.new	2025-04-06 20:50:39.629790961 +0000
@@ -85,21 +85,21 @@ version 1.36
 .IX Header "SYNOPSIS"
 .Vb 1
 \&  use Class::Inspector;
-\&  
+\&
 \&  # Is a class installed and/or loaded
 \&  Class::Inspector\->installed( \*(AqFoo::Class\*(Aq );
 \&  Class::Inspector\->loaded( \*(AqFoo::Class\*(Aq );
-\&  
+\&
 \&  # Filename related information
 \&  Class::Inspector\->filename( \*(AqFoo::Class\*(Aq );
 \&  Class::Inspector\->resolved_filename( \*(AqFoo::Class\*(Aq );
-\&  
+\&
 \&  # Get subroutine related information
 \&  Class::Inspector\->functions( \*(AqFoo::Class\*(Aq );
 \&  Class::Inspector\->function_refs( \*(AqFoo::Class\*(Aq );
 \&  Class::Inspector\->function_exists( \*(AqFoo::Class\*(Aq, \*(Aqbar\*(Aq );
 \&  Class::Inspector\->methods( \*(AqFoo::Class\*(Aq, \*(Aqfull\*(Aq, \*(Aqpublic\*(Aq );
-\&  
+\&
 \&  # Find all loaded subclasses or something
 \&  Class::Inspector\->subclasses( \*(AqFoo::Class\*(Aq );
 .Ve
-------------- next part --------------
  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

-.-

  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)

-.-


More information about the pkg-perl-maintainers mailing list