I would like to create a quality profile in SonarQube that extends PSR2 rules. When I create one using this xml below, sonar shows me the following error:
Unable to import unknown PhpCodeSniffer rule 'PSR2' consider adding an extension in sonar extenions directory
<?xml version="1.0"?>
<ruleset name="test">
<description>test coding standard (extend PSR2).</description>
<!-- Include the whole PSR-2 standard -->
<rule ref="PSR2">
<exclude name="Generic.Files.LineLength" />
</rule>
<!-- Include pear commenting standards -->
<rule ref="PEAR.Commenting.InlineComment"/>
</ruleset>
I have installed sonar 3.7.4 with PHP plugin and PHP_CodeSniffer using pear. CodeSniffer came with following standards:
$ phpcs -i
The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz and Zend
Am I missing some configuration in sonar? What should I do to be able to create the quality profile I want?