Skip to content

Commit

Permalink
Code sniffer config updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Oct 10, 2023
1 parent 76dbdef commit 6d7f96d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"integration-tests"
],
"test:phpcs": [
"phpcs -nps --colors --report-code --report-summary --report-width=80 --cache=tests/cache/phpcs.json --basepath='./' ."
"phpcs -ps --colors --report-code --report-summary --report-width=80 --basepath='./' ."
],
"test:phpstan": [
"codecept build",
Expand Down
20 changes: 14 additions & 6 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<ruleset name="User Switching">
<arg name="cache" value="tests/cache/phpcs.json"/>

<config name="minimum_wp_version" value="5.1"/>
<config name="testVersion" value="7.2-"/>

<!--
Expand All @@ -27,34 +29,40 @@
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="Universal.Files.SeparateFunctionsFromOO.Mixed" />

<!-- These are all false positives: -->
<exclude name="WordPress.Security.NonceVerification.Recommended" />

<!-- Sanity: -->
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
</rule>

<rule ref="WordPress-Docs" />

<rule ref="WordPress.Security.EscapeOutput">
<properties>
<property type="array" name="customAutoEscapedFunctions" value="bp_get_button"/>
<property name="customAutoEscapedFunctions" type="array">
<element value="bp_get_button"/>
</property>
</properties>
</rule>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="user-switching"/>
<property name="text_domain" type="array">
<element value="user-switching"/>
</property>
</properties>
</rule>

<rule ref="WordPress.WP.DeprecatedFunctions">
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="minimum_supported_version" value="5.1" />
<property name="custom_capabilities" type="array">
<element value="switch_to_user"/>
<element value="switch_off"/>
</property>
</properties>
</rule>

</ruleset>

0 comments on commit 6d7f96d

Please sign in to comment.