Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Running phpcs on the Vagrant is undocumented #1182

Closed
mjordan opened this issue Jun 23, 2019 · 5 comments
Closed

Running phpcs on the Vagrant is undocumented #1182

mjordan opened this issue Jun 23, 2019 · 5 comments

Comments

@mjordan
Copy link
Contributor

mjordan commented Jun 23, 2019

phpcs is absent from the Vagrant. Looks like it was provided pre-Ansible.

Running the following shell script from within the drupal install directory, cribbed from the travis setup, works:

#!/bin/bash

echo "Install utilities needed for testing"
mkdir /opt/utils
cd /opt/utils
if [ -z "$COMPOSER_PATH" ]; then
  composer require drupal/coder
else
  php -dmemory_limit=-1 $COMPOSER_PATH require drupal/coder
fi
sudo ln -s /opt/utils/vendor/bin/phpcs /usr/bin/phpcs
phpcs --config-set installed_paths /opt/utils/vendor/drupal/coder/coder_sniffer

Not sure if using shell like this is cool within the Playbook.

@dannylamb
Copy link
Contributor

dannylamb commented Jun 23, 2019 via email

@mjordan
Copy link
Contributor Author

mjordan commented Jun 23, 2019

OK, cool. I think we should add a page the developer docs that explains how to use it. I can open a PR.

@mjordan
Copy link
Contributor Author

mjordan commented Jun 23, 2019

In /var/www/html/drupal, running ./vendor/bin/phpcs --standard=Drupal web/modules/contrib/islandora/src/Plugin/Condition/MediaHasMimetype.php results in the following:

ERROR: the "Drupal" coding standard is not installed. The installed coding standards are MySource, PSR1, Squiz, PSR12, PEAR, Zend and PSR2

Is there another step I should be taking?

@dannylamb
Copy link
Contributor

dannylamb commented Jun 23, 2019 via email

@mjordan
Copy link
Contributor Author

mjordan commented Jun 23, 2019

OK, in /var/www/html/drupal, running ./vendor/bin/phpcs --standard=/var/www/html/drupal/vendor/drupal/coder/coder_sniffer/Drupal web/modules/contrib/islandora/src/Plugin/Condition/MediaHasMimetype.php works as expected. Want me to open a PR to add that docs page?

@mjordan mjordan changed the title Install phpcs on the Vagrant Running phpcs on the Vagrant is undocumented Jun 23, 2019
@mjordan mjordan closed this as completed Jul 4, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants