When I execute git commit, I get this error:
ERROR: the "PHPCompatibility" coding standard is not installed. The installed coding standards are MySource, PEAR, Zend, PSR2, PSR1, Squiz, PSR12, Drupal and DrupalPractice
Fix the PHPCompatibility error before commit please
Then I execute:
phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility
Executed git commit again; a new error appeared again:
ERROR: the "Drupal" coding standard is not installed. The installed coding standards are MySource, PEAR, Zend, PSR2, PSR1, Squiz and PSR12
Fix the Drupal Standard error before commit please
I executed the command again:
phpcs --config-set installed_paths vendor/drupal/coder/coder_sniffer
As a result, the original error appeared again:
the "PHPCompatibility" coding standard is not installed
What's wrong with my configuration?
I understand your pre-commit hook launches a linter that requires both standards to be installed simultaneously:
phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility,vendor/drupal/coder/coder_sniffer
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.