-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"extensions" argument from first included rule clobbers all others #2602
Comments
@TravisCarden Not sure why it is working from the command-line and not from your ruleset, but what I do see is that you're not telling PHPCS as what type of file the new extensions should be interpreted - PHP, JS or CSS. You can explicitly set this by using <arg name="extensions" value="inc,install/php,module/php,php,profile/php,test/php,theme/php,yml"/> I've presumed any "unknown" extension (non- |
…rupal) is specified first when used. Workaround to bug in squizlabs/PHP_CodeSniffer#2602.
…rupal) is specified first when used. Workaround to bug in squizlabs/PHP_CodeSniffer#2602.
Thanks, @jrfnl. That had no effect. However, I think I've found the problem: If I include multiple rules, the mkdir test
cd test
composer init -n
composer require acquia/coding-standards:v0.4.0 dealerdirect/phpcodesniffer-composer-installer
echo '<?php' > test.module
./vendor/bin/phpcs -vs --standard=AcquiaDrupalStrict test.module Upon running PHPCS in the last line you should receive output like this:
But you will instead receive this:
|
This may be related to #2197 |
@TravisCarden I tried to reproduce your solution, without success. I have the same issue, with multiple |
As I recall, @sebastienbarre, the key was that 1) I specified my own extension list in my extensions arg, and 2) that no other rulesets than the one I moved to last specified an extension list. But unless you didn't do number 1, your understanding of the parsing logic wouldn't account for my success. |
@TravisCarden wrong Sebastien, but thx :) |
Oops! Autocomplete failed me. :p |
I maintain a coding standard (acquia/coding-standards) that needs to sniff the various non-
.php
extensions that Drupal uses (e.g.,.module
). I have specified them in my ruleset.xml but with no effect. If I specify them in thephpcs.xml.dist
of a project using the standard it has no effect. If I specify them on the command line they do take effect. Is this a bug or am I doing something wrong?The text was updated successfully, but these errors were encountered: