Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Saving time on checking standards and practice before committing any code.
Drupal coding standard and Drupal Practice check should pass
PHPCS, PHPCBF for both --standard=Drupal and --standard=DrupalPractice
Check Varbase Workflow Drupal coding standard
phpcbf --standard=Drupal --extensions=php,inc,install,test,profile,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_workflow/ --ignore=/var/www/html/products/varbase_workflow/node_modules/ phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_workflow/ --ignore=/var/www/html/products/varbase_workflow/node_modules/
Check Varbase Workflow Drupal Practice
phpcbf --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_workflow/ --ignore=/var/www/html/products/varbase_workflow/node_modules/ phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_workflow/ --ignore=/var/www/html/products/varbase_workflow/node_modules/
Proposed resolution
yarn phpcs
yarn phpcbf
as
"scripts": {
"phpcs": "phpcs --standard=./.phpcs.xml .",
"phpcbf": "phpcbf --standard=./.phpcs.xml ."
},
Comments
Comment #3
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #4
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #5
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #8
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commented