Skip to content

Commit

Permalink
Explicitly include VariableAnalysis standard (#26)
Browse files Browse the repository at this point in the history
* Explicitly include VariableAnalysis standard

* Update composer.json
  • Loading branch information
IanDelMar committed Sep 4, 2024
1 parent 978ab7a commit c82a7bb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
12 changes: 0 additions & 12 deletions PSR12NeutronRuleset/NeutronRuleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
<ruleset name="NeutronRuleset">
<description>Neutron Ruleset.</description>

<rule ref="VariableAnalysis"/>

<!-- VariableAnalysis - customization -->
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable">
<type>error</type>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
<properties>
<property name="allowUnusedCaughtExceptions" value="true"/>
</properties>
</rule>

<!-- NeutronStandard - full set of rules -->
<!-- Covered by Generic.Arrays.DisallowLongArraySyntax
<rule ref="NeutronStandard.Arrays.DisallowLongformArray"/> -->
Expand Down
13 changes: 13 additions & 0 deletions PSR12NeutronRuleset/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@
</rule>
-->

<rule ref="VariableAnalysis">
<!-- Covered by SlevomatCodingStandard.Variables.UnusedVariable -->
<exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable"/>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable">
<type>error</type>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
<properties>
<property name="allowUnusedCaughtExceptions" value="true"/>
</properties>
</rule>

<rule ref="./NeutronRuleset.xml">
<exclude name="Generic.Classes.OpeningBraceSameLine"/>
<exclude name="Generic.Formatting.SpaceAfterCast"/>
Expand Down
22 changes: 12 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"squizlabs/php_codesniffer": "^3.8",
"automattic/phpcs-neutron-ruleset": "^3.4",
"sirbrillig/phpcs-variable-analysis": "^2.0.1",
"slevomat/coding-standard": "^8.0",
"squizlabs/php_codesniffer": "^3.8",
"wp-coding-standards/wpcs": "3.1.0 as 2.3.0"
},
"require-dev": {
"phpcompatibility/php-compatibility": "dev-develop as 10.0.0",
"phpcsstandards/phpcsdevcs": "^1.1"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"sort-packages": true
},
"scripts": {
"test:cs": "phpcs --standard=PHPCSDev PSR12NeutronRuleset/",
"test:e2e": "phpcs --standard=PSR12NeutronRuleset/ruleset.xml tests/smoketest.php",
"test:xml": "xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd PSR12NeutronRuleset/ruleset.xml"
},
"require-dev": {
"phpcsstandards/phpcsdevcs": "^1.0",
"phpcompatibility/php-compatibility": "dev-develop as 10.0.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}

0 comments on commit c82a7bb

Please sign in to comment.