-
Notifications
You must be signed in to change notification settings - Fork 396
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
Allow PHPCS to use DrupalPractice standard #1786
Comments
This could be handled by templating a For example -- https://github.com/thom8/drupalvm-live/blob/a6dcf39921c729f5fc0ecba8c0dff56a02754328/phpcs.xml This has the added benefit of being able to reuse this configuration in an IDE like PHPStorm, https://www.jetbrains.com/help/phpstorm/php-code-sniffer.html#appointCodingStyle |
Agree @thom8 That was going to be next after getting the hardcoded standards path fixed. I would like to see BLT generate a For this issue though, baby steps. Get the standards registered properly, so hardcoded paths can be removed from the calls to PHPCS. |
As I'm not familiar with the BLT code, if someone can point me in the right direction, I'd be happy to create an initial PR for comment. |
@christopher-hopper this is the Class for the https://github.com/acquia/blt/blob/8.x/src/Robo/Commands/Validate/PhpcsCommand.php Perhaps it could skip any configuration if a |
My system information:
When I run this command:
I get the following output:
And I expected this to happen:
I would like to suggest we make use (or allow use of) both the Drupal and DrupalPractice standards that are included in
drupal/coder
. Currently you hard-code a path the Drupal standard, but this is limiting.Since
drupal/coder
version 8.2.11 [8.x-2.11], the package has supported use of Composer installer plugins, such asdealerdirect/phpcodesniffer-composer-installer
, to auto-detect and configure available PHPCS standards found in package dependencies. This means that on any call tocomposer require
,composer install
orcomposer update
, the path to new standards is automatically configured and the standards are available by name.From this point you can use the standards by name, and even specify multiple standards when running PHPCS commands.
When I do this on my project, additional violation warnings, not detected by BLT, are given. Many are very helpful, like this from a custom Block class:
The text was updated successfully, but these errors were encountered: