You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a new external PHPCS standard named `Debug` intended only for use by sniff developers.
This `Debug` standard will contain sniffs which can help sniff developers _during the development of new sniffs_.
Initially, this standard only contains one sniff: `Debug.Debug.TokenList`.
This sniff will display compact, but detailed information about the tokens found in a (test) file.
This sniff is compatible with PHPCS 3.0+.
Typical usage:
* Set up a test case file for a new sniff you intend to write.
* Run PHPCS over the test case file using this standard to see the tokens found listed:
`phpcs ./NewSniffNameUnitTest.inc --standard=Debug`
* Or use it together with the new sniff you are developing:
`phpcs ./NewSniffNameUnitTest.inc --standard=YourStandard,Debug --sniffs=YourStandard.Category.NewSniffName`
PHPCS itself can also display this information using the `-vv` or `-vvv` verbosity flags, however, when using those, you will receive a *lot* more information than just the token list and while useful for debugging PHPCS itself, the additional information is mostly just noise when developing a sniff.
Includes documentation.
Includes unit tests.
PHPCS itself can also display similar information using the `-vv` or `-vvv` verbosity flags, however, when using those, you will receive a *lot* more information than just the token list and, while useful for debugging PHPCS itself, the additional information is mostly just noise when developing a sniff.
167
+
168
+
115
169
### PHPCSDev ruleset for sniff repos
116
170
117
171
Once this project is installed, you will see a new `PHPCSDev` ruleset in the list of installed standards when you run `phpcs -i`.
0 commit comments