I want to use PHP CodeSniffer with the default Drupal
and DrupalPractice
rulesets to check my custom modules. But I definitly don't want the 80 char line length limit, and phpcs is spamming the report with those warnings. I've created a phpcs.xml in my project root (taken from this blog)
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="my_drupal10_phpcs_configuration">
<rule ref="Drupal"/>
<rule ref="DrupalPractice"/>
<arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/>
<exclude-pattern>*/.git/*</exclude-pattern>
<exclude-pattern>*/.vscode/*</exclude-pattern>
<exclude-pattern>*/.idea/*</exclude-pattern>
<exclude-pattern>*/bower_components/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<!--Exclude third party code.-->
<exclude-pattern>*/vendor/*</exclude-pattern>
<file>./web/modules/custom</file>
<file>./web/themes/custom</file>
<!-- MY CHANGE: Ignore the 80char line length limit. -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
</ruleset>
but I still get spammed by messages like
180 | WARNING | Line exceeds 120 characters; contains 141 characters
187 | WARNING | Line exceeds 80 characters; contains 105 characters
How can I override Drupal's 80 chars with a soft limit of 120 chars?