action #138521
opencoordination #96596: [qe-core][CI] CI/CD and Coding style improvements
[qe-core] Add line number to perlpod so its easier to parse the output
0%
Description
A new Add target to check documentation errors #18071 from @mpagot added a new neat script that does a nice check for perlpod, however the following is required to get the line number, and maybe this could be ported to Pod::Perldoc or maybe it could be contributed as a
awk '/Around line/ { # search for lines containing "Around line"
match($0, /[0-9]+/); # extract the line number of the error
getline nextline; # read the error description from the next line
gsub(/^[ \t]+/, "", nextline); # remove leading whitespace from the error message
print "::error file='"${libfile}"',line="substr($0, RSTART, RLENGTH)"::"nextline; # print in a github action compliant way
}' "$tmperrorfile"
Updated by szarate 6 months ago
So, POD checker has some filters:
https://metacpan.org/pod/Pod::Checker --
podchecker -warnings -msg "::" -severity -msg "file='" -filename -msg "," -line ../os-autoinst-distri-opensuse/lib/qesapdeployment.pm ../os-autoinst-distri-opensuse/lib/version
_utils.pm
Updated by mpagot 6 months ago
perlcheck has sensible exit code:
- 0 no errors but could have Warnings
- 1 some errors
- 2 no POD commands (no documentation)
Reported warnings are pretty interesting about final formatting of the html documentation. For example look at formatting of https://os-autoinst.github.io/os-autoinst-distri-opensuse/sles4sap_publiccloud.html and I suspect that perlcheck warnings in that file are about that
*** WARNING: =head2 without preceding higher level at line 62 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 91 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 118 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 188 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 217 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 243 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 264 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 308 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 319 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 342 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 375 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 399 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 416 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 443 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 483 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 508 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 541 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 582 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 604 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 617 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 653 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 664 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 688 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 770 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 793 in file lib/sles4sap_publiccloud.pm
*** WARNING: =head2 without preceding higher level at line 811 in file lib/sles4sap_publiccloud.pm