Skip to content

Commit 653ec7d

Browse files
committed
Rulesets: Add XSD schema tags (PHPCS 3.2+/3.3.2+)
As of PHPCS 3.2.0, PHPCS includes an XSD schema for rulesets which defines what can be used in the XML ruleset file. In PHPCS 3.3.0 a new array format for properties was introduced and as of PHPCS 3.3.2, the new array format is now also covered by this schema. This commit adds the schema tags to the `ruleset.xml` file and the example rulesets.
1 parent 493d5a1 commit 653ec7d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Security/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0"?>
2-
<ruleset name="Security" namespace="PHPCS_SecurityAudit\Security">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Security" namespace="PHPCS_SecurityAudit\Security" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
33
<description>Security related coding standard.</description>
44
</ruleset>

example_base_ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset name="PHPSecurity">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPSecurity" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
33
<description>Rules for standard PHP projects</description>
44

55
<!-- Code Reviews Rules -->

example_drupal7_ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset name="Drupal7Security">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Drupal7Security" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
33
<description>Rules for Drupal 7 projects</description>
44
<!-- Code Reviews Rules -->
55
<!--

0 commit comments

Comments
 (0)