Last active
June 15, 2023 20:58
-
-
Save afragen/341bc1c7f7438cf963d4f6e08f403f40 to your computer and use it in GitHub Desktop.
My PHPCS rulesets using WPCS as a base.
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
<?xml version="1.0"?> | |
<ruleset name="WordPress-Beta-Tester"> | |
<description>Keep long array syntax.</description> | |
<!-- Include main ruleset.xml --> | |
<rule ref="/Users/afragen/code-standards/ruleset.xml"/> | |
<rule ref="Generic.Arrays.DisallowShortArraySyntax" /> | |
<!-- Use only long arrays --> | |
<rule ref="Generic.Arrays"> | |
<exclude name="Generic.Arrays.DisallowLongArraySyntax.Found" /> | |
</rule> | |
</ruleset> |
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
<?xml version="1.0"?> | |
<ruleset name="AJF-Coding-Standards - Short Arrays"> | |
<description>AJF-Coding-Standards, keeping short array syntax.</description> | |
<!-- Include main ruleset.xml --> | |
<rule ref="/Users/afragen/code-standards/ruleset.xml"/> | |
<!-- Use short arrays --> | |
<rule ref="Generic.Arrays"> | |
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" /> | |
</rule> | |
<!-- Use parse_url(), file_get_contents(), json_encode() --> | |
<rule ref="WordPress.WP"> | |
<exclude name="WordPress.WP.AlternativeFunctions.parse_url_parse_url"/> | |
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/> | |
<exclude name="WordPress.WP.AlternativeFunctions.json_encode_json_encode"/> | |
</rule> | |
</ruleset> |
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
<?xml version="1.0"?> | |
<ruleset name="WordPress-Core-Plugins"> | |
<description>Keep long array syntax.</description> | |
<!-- Show progress and sniff codes in all reports --> | |
<arg value="ps"/> | |
<!-- Exclude these --> | |
<exclude-pattern>*/vendor/*</exclude-pattern> | |
<exclude-pattern>*/tests/*</exclude-pattern> | |
<exclude-pattern>*/node_modules/*</exclude-pattern> | |
<rule ref="WordPress-Core"> | |
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | |
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | |
</rule> | |
<rule ref="WordPress"> | |
<!-- <exclude name="WordPress.Files.FileName" /> --> | |
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | |
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | |
<exclude name="WordPress.NamingConventions.ValidVariableName" /> | |
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText" /> | |
<exclude name="WordPress.PHP.NoSilencedErrors.Discouraged" /> | |
<exclude name="WordPress.PHP.DisallowShortTernary.Found" /> | |
</rule> | |
<!-- Enforce space before closing parenthesis --> | |
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"> | |
<severity>5</severity> | |
</rule> | |
<rule ref="Generic.Arrays.DisallowShortArraySyntax" /> | |
<!-- Use only long arrays --> | |
<rule ref="Generic.Arrays"> | |
<exclude name="Generic.Arrays.DisallowLongArraySyntax.Found" /> | |
</rule> | |
</ruleset> |
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
<?xml version="1.0"?> | |
<ruleset name="AJF-Coding-Standards"> | |
<description>A custom ruleset to take in account both WordPress and personal standards.</description> | |
<config name="installed_paths" value="/Users/afragen/wpcs" /> | |
<!-- Show progress and sniff codes in all reports --> | |
<arg value="ps"/> | |
<!-- Exclude these --> | |
<exclude-pattern>*/vendor/*</exclude-pattern> | |
<exclude-pattern>*/tests/*</exclude-pattern> | |
<exclude-pattern>*.js</exclude-pattern> | |
<exclude-pattern>*/node_modules/*</exclude-pattern> | |
<rule ref="WordPress-Core"> | |
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | |
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | |
</rule> | |
<rule ref="WordPress"> | |
<!-- <exclude name="WordPress.Files.FileName" /> --> | |
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | |
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | |
<exclude name="WordPress.NamingConventions.ValidVariableName" /> | |
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText" /> | |
<exclude name="WordPress.PHP.NoSilencedErrors.Discouraged" /> | |
<exclude name="WordPress.PHP.DisallowShortTernary.Found" /> | |
</rule> | |
<!-- Enforce space before closing parenthesis --> | |
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"> | |
<severity>5</severity> | |
</rule> | |
</ruleset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment