Closed jrfnl closed 5 years ago
For an example of how to implement this: https://github.com/squizlabs/PHP_CodeSniffer/pull/2187
Should we put this in 0.2.0 release or later?
I think it can be safely added now as long as the Travis check is added in a build against PHPCS master
.
Note: since then one more oversight has been discovered in the PHPCS XSD file, but I don't think this will be a problem for TRTCS as I don't think that feature is used in the ruleset.
There is an open PR upstream to fix it which is expected to go into PHPCS 3.5.0: https://github.com/squizlabs/PHP_CodeSniffer/pull/2491
I'll tag this for later, as it's not a crucial feature for this release 🙂
As it is such a simple change which can contribute significantly to the QA, I've just pulled it now.
Dependency Version
When the PHP_CodeSniffer dependency is at least version 3.3.2 (not yet released at the time of writing), then take the actions below.
Action checklist
Note: we could probably use a relative schema location like
../vendor/squizlabs/php_codesniffer/phpcs.xsd
as people are required to install WPCS with Composer, so we can rely on thexsd
to be available in that location.Rationale:
An XSD schema definition file defines the expected format of an XML file. It defines the elements and attributes which can be used in the XML file and in which order those can be used.
Adding an XSD schema reference to an XML file will allow for stricter validation of the file to ensure it is valid for the purpose for which it is intended to be used, in this case: that it is a valid ruleset for use with PHPCS.
References: