You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests: kdoc: handle buggy "line number only" warnings
Some versions of kernel-doc currently report certain warnings with only
their line number. This breaks the logic of the kdoc test, as such lines do
not pass the expected format defined by the KdocWarning class.
Such warnings appear to indicate duplicate section headers in a kernel doc
entry, but the text of the warning is not properly displayed.
As a result, the kdoc test produces false positive failures for patches
which touch files that have such warnings. The line contents are compared
without ignoring the line numbers. This produces output failures:
Warnings before: 7 after: 7 (add: 2 del: 2)
Warnings removed:
Warning: 174
Warning: 184
Per-file breakdown:
2 None
New warnings added:
Warning: 180
Warning: 196
Per-file breakdown:
2 None
Since the warnings are compared directly, the changing line numbers are
detected as differences.
This is a bug in the kernel-doc script, and a proper fix requires updating
the script to stop producing such warnings. In the mean time, the NIPA
tests continue to fail. To fix that, use a separate regular expression to
identify lines of the form 'Warning: <number>'. Set the content of such
warnings to None.
This will make all such warnings compare as identical in the existing
algorithm, and thus the changing line numbers will no longer cause such a
false positive.
To avoid introducing further regressions, extend the check to count the
total number of unparsed warnings. If it increases, then also fail the kdoc
test. This way, we will correctly fail when we see more empty warnings
after applying the current patch.
This also should help catch issues for other types of unrecognized warnings
in the future. Note that all warnings still get compared in the usual way,
where fully unrecognized warnings will be compare the lines as-is without
eliding the line number comparison. This just adds an additional safety
guard in addition to handling the empty warning case.
Signed-off-by: Jacob Keller <[email protected]>
0 commit comments