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 Total Control Dashboard Drupal coding standard
phpcbf --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_total_control/ --ignore=/var/www/html/products/varbase_total_control/node_modules/ phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_total_control/ --ignore=/var/www/html/products/varbase_total_control/node_modules/
Check Varbase Total Control Dashboard Drupal Practice
phpcbf --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_total_control/ --ignore=/var/www/html/products/varbase_total_control/node_modules/ phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_total_control/ --ignore=/var/www/html/products/varbase_total_control/node_modules/
Proposed resolution
yarn eslint
yarn stylelint
yarn phpcs
yarn phpcbf
as
"scripts": {
"eslint": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json .",
"stylelint": "npx stylelint --config=.stylelintrc.json .",
"phpcs": "phpcs --standard=./.phpcs.xml .",
"phpcbf": "phpcbf --standard=./.phpcs.xml ."
},
Comments
Comment #3
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedFor the 8.x-6.x-dev branch
The inline commands
yarn phpcs
yarn phpcbf
yarn eslint
yarn stylelint
Comment #4
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedFor the 9.0.x branch
gulp compile
The inline commands
yarn phpcs
yarn phpcbf
yarn eslint
yarn stylelint
Comment #8
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #9
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #10
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #11
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #12
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #13
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commented