RFC: Adding progressive XML lint for the specs#726
RFC: Adding progressive XML lint for the specs#726ocampana-videotec wants to merge 3 commits intodevelopmentfrom
Conversation
melanconj
left a comment
There was a problem hiding this comment.
Ideally I'd say we should have a github action running automatically in the PRs to block (or auto-fix?) incorrect changes and ensure we properly apply it.
Otherwise, I'm all for it
|
The final goal is to invoke this script by a GitHub action. This initial draft PR is meant to gather feedback from other members, both on the idea per se and on the script. @melanconj did you have the time to give it a try? |
With this change, we make sure to run progressive_lint.py before the wsdl checkers.
|
@melanconj I just pushed an update of the PR, unifying the execution of the script and the two checkers based on gsoap and dotnet into a unique action. I will now debug it. |
|
@melanconj I think this is the expected behavior. This is why I wrote
The point is that I merged the PR to compile the PTZ specs in the GitHub action, therefore development and your branch increased the difference, but on the development side. I will dig into it, but could you please let me know what branch you are working on? |
|
@melanconj , I changed the logic. Instead of doing
the script now does
Therefore it beautifies not all the different lines between the current branch and I tried it between |
|
Yeah but I don't think "adds 6 indentation layers at once on a random <inlineequation>" is the intended behavior. It did that on quite a few things |
|
I think it is not on random lines. Did you try the updated version? In any case, let's review how it works at the next F2F meeting |

While working on fixing #555 , several issues of indenting (replacing spaces with tabs or vice versa), encoding (UTF8 vs Windows-1252) and xml code quality became evident.
ONVIF will always have open PRs, therefore we cannot have a cleaning moment to reset the status of the doc. With this PR, I am presenting the idea of introducing progressive XML linting in the specs, based on the script
.github\scripts\progressive_xml_lint.pyand GitHub actions.How progressive_xml_lint.py works
The script currently operates on files ending with
.xml,.xsdand.wsdl. It uses white spaces for intending and at the time of this proposal it indents with four of them.The script checks the difference with a base reference, and only on the changed lines it applies the following changes:
<programlisting>tag, to avoid messing with code-related textThe idea at the bottom of the script is that progressively, we should beautify commit after commit the specs and reach to a point where linting the whole file should not heavily impact our work.
The current configuration of the tool is
but I do not pretend this would be the definitive one.
How to test it
The easiest way is to checkout locally the
tc/progressive_xml_lintbranch and to merge in one of your branchesPlease, let me know what you think of the idea.