Skip to content

Commit b1af253

Browse files
authored
Merge pull request #29 from PHPCSStandards/feature/remove-dev-ruleset
Remove the PHPCSDev ruleset
2 parents 02bdad2 + fe83c0e commit b1af253

File tree

4 files changed

+7
-257
lines changed

4 files changed

+7
-257
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ jobs:
5555
# Validate the xml file.
5656
# @link http://xmlsoft.org/xmllint.html
5757
- xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./PHPCSDebug/ruleset.xml
58-
- xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./PHPCSDev/ruleset.xml
5958

6059
# Check the code-style consistency of the xml files.
6160
- diff -B ./PHPCSDebug/ruleset.xml <(xmllint --format "./PHPCSDebug/ruleset.xml")
62-
- diff -B ./PHPCSDev/ruleset.xml <(xmllint --format "./PHPCSDev/ruleset.xml")
6361

6462
# Validate the composer.json file.
6563
# @link https://getcomposer.org/doc/03-cli.md#validate
@@ -117,6 +115,11 @@ before_install:
117115
- export XMLLINT_INDENT=" "
118116

119117
# Set up test environment using Composer.
118+
- |
119+
if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Sniff" ]]; then
120+
# Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs.
121+
composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts
122+
fi
120123
- |
121124
if [[ $PHPCS_VERSION != "n/a" ]]; then
122125
composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION}

PHPCSDev/ruleset.xml

Lines changed: 0 additions & 221 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ This is a set of tools to aid developers of sniffs for [PHP CodeSniffer](https:/
2525
* [Features](#features)
2626
+ [Checking whether all sniffs in a PHPCS standard are feature complete](#checking-whether-all-sniffs-in-a-phpcs-standard-are-feature-complete)
2727
+ [Sniff Debugging](#sniff-debugging)
28-
+ [PHPCSDev ruleset for sniff repos](#phpcsdev-ruleset-for-sniff-repos)
2928
* [Contributing](#contributing)
3029
* [License](#license)
3130

@@ -168,37 +167,6 @@ Ptr :: Ln :: Col :: Cond :: Token Type :: [len]: Content
168167
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.
169168

170169

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-
202170
Contributing
203171
-------
204172
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.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
"require" : {
2323
"php" : ">=5.4",
2424
"squizlabs/php_codesniffer" : "^3.0.2",
25-
"phpcompatibility/php-compatibility" : "^9.0.0",
2625
"dealerdirect/phpcodesniffer-composer-installer" : "^0.3 || ^0.4.1 || ^0.5 || ^0.6"
2726
},
2827
"require-dev" : {
2928
"roave/security-advisories" : "dev-master",
3029
"phpunit/phpunit" : "^4.5 || ^5.0 || ^6.0 || ^7.0",
3130
"jakub-onderka/php-parallel-lint": "^1.0",
32-
"jakub-onderka/php-console-highlighter": "^0.4"
31+
"jakub-onderka/php-console-highlighter": "^0.4",
32+
"phpcsstandards/phpcsdevcs": "^1.0.0"
3333
},
3434
"bin": [
3535
"bin/phpcs-check-feature-completeness"

0 commit comments

Comments
 (0)