You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a minimal.php file with the following contents:
<?phpfunctionminimal_example() {
}
Run ./vendor/bin/phpcs --standard=AcquiaDrupalStrict minimal.php
Output:
--------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------
Rename minimal.php to minimal.install
Run ./vendor/bin/phpcs --standard=AcquiaDrupalStrict minimal.install
Output:
No output
Run ./vendor/bin/phpcs --standard=Drupal minimal.install
Output:
------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------
I suspect this issue exists for all non-standard PHP_CodeSniffer file extensions, but I only verified install files.
Having <arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/> in my own phpcs.xml.dist file does not alter the behavior. Including <rule ref="Drupal" /> prior to <rule ref="AcquiaDrupalStrict" /> does wind up sniffing install files.
The text was updated successfully, but these errors were encountered:
I've identified the problem. It seems indeed to be a bug in PHP_CodeSniffer. I've worked around it in 3ea1e57 and released it in v0.4.0. Thanks again for reporting this, @swichers!
Create a
minimal.php
file with the following contents:Run
./vendor/bin/phpcs --standard=AcquiaDrupalStrict minimal.php
Output:
Rename
minimal.php
tominimal.install
Run
./vendor/bin/phpcs --standard=AcquiaDrupalStrict minimal.install
Output:
No output
Run
./vendor/bin/phpcs --standard=Drupal minimal.install
Output:
I suspect this issue exists for all non-standard PHP_CodeSniffer file extensions, but I only verified install files.
Having
<arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/>
in my own phpcs.xml.dist file does not alter the behavior. Including<rule ref="Drupal" />
prior to<rule ref="AcquiaDrupalStrict" />
does wind up sniffing install files.The text was updated successfully, but these errors were encountered: