Skip to content

Instantly share code, notes, and snippets.

@igmoweb
Created December 19, 2017 13:23
Show Gist options
  • Save igmoweb/fc70bee19af46f42e48a11d70893ed13 to your computer and use it in GitHub Desktop.
Save igmoweb/fc70bee19af46f42e48a11d70893ed13 to your computer and use it in GitHub Desktop.
PHPCS with a bunch of rules
<?xml version="1.0"?>
<ruleset name="My-Project">
<description>Sniffs for the coding standards of your project.</description>
<file>.</file>
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- wpcs installed path -->
<config name="installed_paths" value="/Users/ignacio/.composer/vendor/wp-coding-standards/wpcs" />
<!-- PHPCS WP Aliases. Needed to execute WP Rules -->
<autoload>/Users/ignacio/.composer/vendor/wp-coding-standards/wpcs/WordPress/PHPCSAliases.php</autoload>
<!-- Just check php files -->
<arg name="extensions" value="php"/>
<!-- Colors! Nice! -->
<arg name="colors"/>
<!-- Full report -->
<arg name="report" value="full"/>
<rule ref="WordPress">
<!-- Disable Yoda conditions check as an example. -->
<exclude name="WordPress.PHP.YodaConditions" />
</rule>
<!-- Add this rule too -->
<rule ref="/Users/ignacio/.composer/vendor/fig-r/psr2r-sniffer/PSR2R/Sniffs/ControlStructures/NoInlineAssignmentSniff.php"/>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment