Description
Is your feature request related to a problem?
While reviewing #705 (review), I noticed that in the code documentation, PHPCS specifies that there are two possible values for the type
attribute of the <exclude-pattern>
and <include-pattern>
tags that can be used in a ruleset file: absolute
and relative
.
PHP_CodeSniffer/src/Ruleset.php
Lines 48 to 57 in 9c8f30f
PHP_CodeSniffer/src/Ruleset.php
Lines 59 to 68 in 9c8f30f
But the code does not validate that one of those values is passed and any value is accepted:
PHP_CodeSniffer/src/Ruleset.php
Line 1232 in 9c8f30f
PHP_CodeSniffer/src/Ruleset.php
Line 1258 in 9c8f30f
Adding the following to a ruleset.xml file, will add a exclude pattern (called ignore pattern in the code) with the type InvalidValue
:
<exclude-pattern type="InvalidValue">./vendor/*</exclude-pattern>
Describe the solution you'd like
PHPCS should validate the values passed to the type
attribute and warn users if an invalid value is passed.
Additional context (optional)
- I have read the Contribution Guidelines and this is not a support question.
- I intend to create a pull request to implement this feature.