Skip to content

Commit

Permalink
Merge pull request #2409 from WordPress/feature/phpcsextra-1.2.0-sniffs
Browse files Browse the repository at this point in the history
Use two new sniffs from PHPCSExtra 1.2.0
  • Loading branch information
dingo-d authored Dec 3, 2023
2 parents fe78958 + 253a1fc commit 17cc585
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ When you introduce new `public` sniff properties, or your sniff extends a class
* WordPress-Coding-Standards
* PHP_CodeSniffer 3.7.2 or higher
* PHPCSUtils 1.0.8 or higher
* PHPCSExtra 1.1.0 or higher
* PHPCSExtra 1.2.0 or higher
* PHPUnit 4.x, 5.x, 6.x or 7.x

The WordPress Coding Standards use the `PHP_CodeSniffer` native unit test framework for unit testing the sniffs.
Expand Down
3 changes: 3 additions & 0 deletions WordPress-Core/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@
<!-- Important to prevent issues with content being sent before headers. -->
<rule ref="Generic.Files.ByteOrderMark"/>

<!-- Always have a lowertag PHP open tag. -->
<rule ref="Universal.PHP.LowercasePHPTag"/>

<!-- All line endings should be \n. -->
<rule ref="Generic.Files.LineEndings">
<properties>
Expand Down
3 changes: 3 additions & 0 deletions WordPress-Extra/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
<!-- Detect useless "echo sprintf(...)". -->
<rule ref="Universal.CodeAnalysis.NoEchoSprintf"/>

<!-- Detect use of double negative `!!`. -->
<rule ref="Universal.CodeAnalysis.NoDoubleNegative"/>

<!--
#############################################################################
Code style sniffs for more recent PHP features and syntaxes.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ext-xmlreader": "*",
"squizlabs/php_codesniffer": "^3.7.2",
"phpcsstandards/phpcsutils": "^1.0.8",
"phpcsstandards/phpcsextra": "^1.1.0"
"phpcsstandards/phpcsextra": "^1.2.0"
},
"require-dev": {
"phpcompatibility/php-compatibility": "^9.0",
Expand Down

0 comments on commit 17cc585

Please sign in to comment.