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 profile Drupal coding standard
phpcbf --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,scss,less,css,info,yml /var/www/html/products/varbase/ --ignore="/var/www/html/products/varbase/node_modules/, tests/features/bootstrap/" phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,scss,less,css,info,yml /var/www/html/products/varbase/ --ignore="/var/www/html/products/varbase/node_modules/, tests/features/bootstrap/"
Check Varbase profile Drupal Practice
phpcbf --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,scss,less,css,info,yml /var/www/html/products/varbase/ --ignore="/var/www/html/products/varbase/node_modules/, tests/features/bootstrap/" phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,scss,less,css,info,yml /var/www/html/products/varbase/ --ignore="/var/www/html/products/varbase/node_modules/, tests/features/bootstrap/"
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 #2
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commented...
Comment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedyarn phpcs
yarn phpcbf
yarn eslint
yarn stylelint
Comment #8
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #9
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #10
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #11
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commented