phpcs
is installed on the system and code sniffing works fine from the command line.
phpcs --extensions=php /path/to/code.php`
^ works fine.
For the PHP Storm IDE, I've specified the location of the ruleset.xml file in the settings like so:
Cmd
+ ,
> PHP Code Sniffer validation
> Coding standard
> Custom
> Path to ruleset.xml
However, I get this error:
PHP Code Sniffer
phpcs: /Users/gketkar/code-sniffer/Blah/ruleset.xml: line 1: syntax error near unexpected token `newline'
/Users/gketkar/code-sniffer/Blah/ruleset.xml: line 1: `<?xml version="1.0"?>'
UPDATE: The ruleset.xml file looks like this:
<?xml version="1.0"?>
<ruleset name="Blah">
<description>Blah Coding Standards</description>
<rule ref="Generic">
<exclude name="Generic.Formatting.SpaceAfterCast.NoSpace"/>
<exclude name="Generic.PHP.DeprecatedFunctions"/>
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/>
<exclude name="Generic.PHP.UpperCaseConstant.Found"/>
</rule>
</ruleset>