- 🇪🇸Spain rodrigoaguilera Barcelona
An example phpcs run showing the errors
https://git.drupalcode.org/project/font_awesome/-/jobs/5453102
Setting up phpcs with Drupal coding standards flags js as needing uppercase FALSE,TRUE and NULL
Setup the following phpcs.xml file
<?xml version="1.0"?>
<ruleset name="MyRules">
<rule ref="Drupal">
</rule>
<rule ref="DrupalPractice">
</rule>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/dist/css/*</exclude-pattern>
<exclude-pattern>*/dist/js/*</exclude-pattern>
<file>docroot/modules/custom</file>
<file>docroot/themes/custom</file>
</ruleset>
I added the following to fix it
<rule ref="Generic.PHP.UpperCaseConstant">
<exclude-pattern>docroot/themes/custom/*/src/js</exclude-pattern>
</rule>
It has been many years since I was setting up phpcs for a Drupal project but I don't remember needing this workaround. Why a php sniff would be scanning a js file? is there something wrong in my config?
No idea
Active
8.3
Coder Sniffer
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
An example phpcs run showing the errors
https://git.drupalcode.org/project/font_awesome/-/jobs/5453102