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
Copy file name to clipboardExpand all lines: README.md
-32Lines changed: 0 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,6 @@ This is a set of tools to aid developers of sniffs for [PHP CodeSniffer](https:/
25
25
*[Features](#features)
26
26
+[Checking whether all sniffs in a PHPCS standard are feature complete](#checking-whether-all-sniffs-in-a-phpcs-standard-are-feature-complete)
27
27
+[Sniff Debugging](#sniff-debugging)
28
-
+[PHPCSDev ruleset for sniff repos](#phpcsdev-ruleset-for-sniff-repos)
29
28
*[Contributing](#contributing)
30
29
*[License](#license)
31
30
@@ -168,37 +167,6 @@ Ptr :: Ln :: Col :: Cond :: Token Type :: [len]: Content
168
167
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.
169
168
170
169
171
-
### PHPCSDev ruleset for sniff repos
172
-
173
-
Once this project is installed, you will see a new `PHPCSDev` ruleset in the list of installed standards when you run `phpcs -i`.
174
-
175
-
**Important: This ruleset currently requires PHP_CodeSniffer >= `3.5.0+`.**
176
-
177
-
> As sniffs developers will mostly work with the latest version of PHP_CodeSniffer, this shouldn't cause any problems.
178
-
>
179
-
> Similarly, the CS check in automated CI runs should normally be run on a high PHPCS version for the best results.
180
-
181
-
The `PHPCSDev` standard can be used by sniff developers to check the code style of their sniff repo code.
182
-
183
-
Often, sniff repos will use the code style of the standard they are adding. However, not all sniff repos are actually about code style.
184
-
185
-
So for those repos which need a basic standard which will still keep their code-base consistent, this standard should be useful.
186
-
187
-
The standard checks your code against the following:
188
-
* Compliance with [PSR-12](https://www.php-fig.org/psr/psr-12/), with a few exceptions.
189
-
* Use of camelCase variable and function names.
190
-
* Use of normalized arrays.
191
-
* All files, classes, functions and properties are documented with a docblock and contain the minimally needed information.
192
-
* A small number of arbitrary additional code style checks.
193
-
* PHP cross-version compatibility, while allowing for the tokens back-filled by PHPCS itself.
194
-
Note: for optimal results, the project custom ruleset should set the `testVersion` config variable.
195
-
This is not done by default as config variables are currently [difficult](https://github.com/squizlabs/PHP_CodeSniffer/issues/2197)[to overrule](https://github.com/squizlabs/PHP_CodeSniffer/issues/1821).
196
-
197
-
The ruleset can be used like any other ruleset and specific sniffs and settings can be added to or overruled from a custom project based ruleset.
198
-
199
-
For an example project-based ruleset using the `PHCPSDev` standard, have a look at the [`phpcs.xml.dist` file](https://github.com/PHPCSStandards/PHPCSDevTools/blob/develop/phpcs.xml.dist) in this repo.
200
-
201
-
202
170
Contributing
203
171
-------
204
172
Contributions to this project are welcome. Just clone the repo, branch off from `develop`, make your changes, commit them and send in a pull request.
0 commit comments