Skip to content

Commit

Permalink
simplify code standard configuration file #22
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegApanovich committed Nov 8, 2023
1 parent bf7ef3f commit 844e992
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions config/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,38 @@
<description>Plugin dev PHP_CodeSniffer ruleset.</description>

<file>.</file>
<rule ref="WordPress" />

<!-- Exclude paths -->
<exclude-pattern>lib</exclude-pattern>
<exclude-pattern>vendor</exclude-pattern>
<exclude-pattern>languages</exclude-pattern>
<exclude-pattern>src/WoocommerceImporter</exclude-pattern>

<!-- We allow using fopen and flose instead -->

<rule ref="WordPress">
<!-- We allow using fopen and fclose instead -->
<exclude name="WordPress.WP.AlternativeFunctions.file_system_read_fopen"/>
</rule>
<rule ref="WordPress">
<exclude name="WordPress.WP.AlternativeFunctions.file_system_read_fclose"/>
</rule>
<!-- Exclude due to PSR-4 autoload intagration -->
<rule ref="WordPress">
<!-- Exclude due to PSR-4 autoload integration -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
</rule>
<!-- Exclude due to PSR-4 autoload intagration -->
<rule ref="WordPress">
<!-- Exclude due to PSR-4 autoload integration -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
</rule>
<!-- We do not comment params in functions doc block of our project -->
<rule ref="WordPress">
<!-- We do not comment params in functions doc block of our project -->
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
</rule>
<!-- We do not comment trows in functions doc block of our project -->
<rule ref="WordPress">
<!-- We do not comment trows in functions doc block of our project -->
<exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/>
</rule>
<!-- We allow to use php standard file interaction functions -->
<rule ref="WordPress">
<!-- We allow to use php standard file interaction functions -->
<exclude name="WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents"/>
</rule>

<!-- Single file rule configuration -->

<!-- Single file rule configurations -->
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_putenv">
<exclude-pattern>src/Services/GoogleApiTokenAssertionMethodService.php</exclude-pattern>
</rule>
<!-- Nonce settings tab -->
<rule ref="WordPress.Security.NonceVerification.Recommended">
<exclude-pattern>src/Models/AdminSettingsModel.php</exclude-pattern>
</rule>
<!-- Nonce settings tab -->
<rule ref="WordPress.Security.NonceVerification.Recommended">
<exclude-pattern>includes/helpers.php</exclude-pattern>
</rule>
Expand Down

0 comments on commit 844e992

Please sign in to comment.