Standards should be referenced by name#79
Standards should be referenced by name#79szepeviktor wants to merge 2 commits intowebimpress:masterfrom
Conversation
|
See |
| <ruleset name="MyCodingStandard" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd"> | ||
| <rule ref="./vendor/webimpress/coding-standard/ruleset.xml"/> |
There was a problem hiding this comment.
Can you explain what's wrong with that method?
There was a problem hiding this comment.
All phpcs ruleset I've seen/made have a name and can be used by its name.
There was a problem hiding this comment.
Not sure if this is still relevant, but I came across this PR when looking for something else.
@michalbundyra I've previously seen issues with sniff name based configuration not always working 100% correctly when a ruleset is imported via a file ref vs by name.
I suppose I should do a deep-dive into this at some point, but I agree with the recommendation that standards containing sniffs should be reference-able by name and that the recommendation should be to register them in installed_paths and include them by name.
Also see my comments here:
There was a problem hiding this comment.
Thanks, @jrfnl ! I'll have a look and try to sort it out.
| <file>test</file> | ||
| <file>config/</file> | ||
| <file>src/</file> | ||
| <file>test/</file> |
There was a problem hiding this comment.
I guess these are not really needed?
There was a problem hiding this comment.
Not really. They show that for example src is a directory, not a file.
|
|
||
| <!-- display progress --> | ||
| <arg value="p"/> | ||
| <arg name="colors"/> |
There was a problem hiding this comment.
Why these are removed?
I wanted to have enabled progress and colours by default.
There was a problem hiding this comment.
Because command line options should be in the user's phpcs.xml, not in the coding standard.
Should I move args to the example in README?