Skip to content

Instantly share code, notes, and snippets.

@danieliser
Last active April 24, 2020 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieliser/a50c09a1f04f6f3055868634c3c7518b to your computer and use it in GitHub Desktop.
Save danieliser/a50c09a1f04f6f3055868634c3c7518b to your computer and use it in GitHub Desktop.
Code Atlantic PHPCS Coding Standards
<?xml version="1.0"?>
<ruleset name="Code Atlantic - Coding-Standards - Short Arrays">
<description>Code Atlantic Coding-Standards, keeping short array syntax.</description>
<!-- Include main ruleset.xml -->
<rule ref="./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>
<?xml version="1.0"?>
<ruleset name="Code Atlantic - Coding-Standards">
<description>A custom ruleset to take in account both WordPress and company standards.</description>
<config name="installed_paths" value="/home/daniel/.composer/vendor/wp-coding-standards/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>
<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