- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6
Description
Is your feature request related to a problem?
XML docs for sniffs should have consistent formatting, but this can't currently be checked automatically as the xmllint + diff commands need the file name of each individual file to be checked, which (without a script to provide those names) would mean the check in GH actions would need to be manually updated each time a docs file is added, which makes it fiddly and something which will easily go out of date/miss files which should be checked.
This feature request was originally in the WPCS repo, but as it looks like it would be possible to handle this via a portable bash script, it would make sense to add that script to this package and make it available for (re)use by any PHPCS related repo which provides XML docs for sniffs.
Describe the solution you'd like
See the conversation here: WordPress/WordPress-Coding-Standards#2334 (comment)
Basically we'd need a little (bash or otherwise) script to gather the files in the
WordPress/Docsdirectory and then run the following command against each file withXMLLINT_INDENTset to (four) spaces.diff -B --tabsize=4 ./WordPress/Docs/Cat/SniffNameStandard.xml <(xmllint --format "./WordPress/Docs/Cat/SniffNameStandard.xml")
Additional context (optional)
In the original ticket, @viditagrawal56 has already posted an outline of a script which could be used for this and has indicated they would like to continue working on this feature.
This ticket is intended to talk through further implementation details for the feature.