squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.67k stars 1.48k forks source link

Docs: fix invalid XML docs for three sniffs #3674

Closed jrfnl closed 1 year ago

jrfnl commented 2 years ago

Each of these three sniffs had a <code_comparison> block containing three <code> elements instead of two.

Discovered by validating the docs against the XSD schema created by the amazing @dingo-d. The XSD schema is now available in PHPCSDevTools 1.2.0 as discussed in #3585.

If you're interested, I could refresh (a variation of) PR #2872 to add XML doc validation against the schema to the GH Actions checks.

gsherwood commented 1 year ago

Thanks. All those docs changes make perfect sense.

jrfnl commented 1 year ago

If you're interested, I could refresh (a variation of) PR https://github.com/squizlabs/PHP_CodeSniffer/pull/2872 to add XML doc validation against the schema to the GH Actions checks.

Should I prepare that GH Actions addition to safeguard this for all XML docs from now on ?

The GH Action change doesn't require a dependency on PHPCSDevTools, it could just download the XSD file using curl, though having the PHPCSDevTools dev dependency would make it easier for contributors to run the same check locally.