Skip to content

Commit

Permalink
add phpcs ruleset for better coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
mehul0810 committed Sep 26, 2020
1 parent 051c35e commit 8c4ca7a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions phpcs.ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<ruleset name="Plausible Analytics Coding Standards">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->

<!-- Set a description for this ruleset. -->
<description>We love clean code for Plausible Analytics. This will let us enforce that easily.</description>

<!-- Default tab width for indentation fixes and such. -->
<arg name="tab-width" value="4"/>

<!-- Exclude directories we don't want checked. -->
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>languages/*</exclude-pattern>
<exclude-pattern>assets/*</exclude-pattern>

<!-- Bring in WP rules. -->
<rule ref="WordPress-Core">
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
</rule>

<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
<type>warning</type>
</rule>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="plausible-analytics"/>
</properties>
</rule>
</ruleset>

0 comments on commit 8c4ca7a

Please sign in to comment.