forked from plausible/wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add phpcs ruleset for better coding standards
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |