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 Vartheme BS4 (Bootstrap 4 - SASS) Drupal coding standard
phpcbf --standard=Drupal --extensions=php,inc,install,test,profile,theme,scss,css,info,txt,md,yml /var/www/html/products/vartheme_bs4/ --ignore="/var/www/html/products/vartheme_bs4/node_modules/ , /var/www/html/products/vartheme_bs4/VARTHEME_BS4_SUBTHEME/node_modules/" phpcs --standard=Drupal --extensions=php,inc,install,test,profile,theme,scss,css,info,txt,md,yml /var/www/html/products/vartheme_bs4/ --ignore="/var/www/html/products/vartheme_bs4/node_modules/ , /var/www/html/products/vartheme_bs4/VARTHEME_BS4_SUBTHEME/node_modules/"Check Vartheme BS4 (Bootstrap 4 - SASS) Drupal Practice
phpcbf --standard=DrupalPractice --extensions=php,inc,install,test,profile,theme,scss,css,info,txt,md,yml /var/www/html/products/vartheme_bs4/ --ignore="/var/www/html/products/vartheme_bs4/node_modules/ , /var/www/html/products/vartheme_bs4/VARTHEME_BS4_SUBTHEME/node_modules/" phpcs --standard=DrupalPractice --extensions=php,inc,install,test,profile,theme,scss,css,info,txt,md,yml /var/www/html/products/vartheme_bs4/ --ignore="/var/www/html/products/vartheme_bs4/node_modules/ , /var/www/html/products/vartheme_bs4/VARTHEME_BS4_SUBTHEME/node_modules/"
Proposed resolution
In Vartheme BS4 base theme
Having the following yarn script commands
yarn eslint
yarn stylelint
yarn phpcs
yarn phpcbf
as in the list of yarn scripts
"scripts": {
"theme:init": "gulp",
"theme:build": "gulp compile",
"theme:watch": "gulp watch",
"theme:create-sub-theme": "bash ./scripts/create-new-vartheme-bs4.sh",
"eslint": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json .",
"stylelint": "npx stylelint --config=.stylelintrc.json .",
"prettier": "prettier --write \"./js/**/*.es6.js\"",
"phpcs": "phpcs --standard=./.phpcs.xml .",
"phpcbf": "phpcbf --standard=./.phpcs.xml ."
},
And for VARTHEM_BS4_SUBTHEME too to work in dev of Vartheme BS4 or in outer projects.
In VARTHEM_BS4_SUBTHEME
Have the following yarn script commands
yarn eslint
yarn stylelint
yarn phpcs
yarn phpcbf
as in the list of yarn scripts
"scripts": {
"theme:init": "gulp",
"theme:build": "gulp compile",
"theme:watch": "gulp watch",
"eslint": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json .",
"stylelint": "npx stylelint --config=.stylelintrc.json .",
"prettier": "prettier --write \"./js/**/*.es6.js\"",
"phpcs": "phpcs --standard=./.phpcs.xml .",
"phpcbf": "phpcbf --standard=./.phpcs.xml ."
},
Comments
Comment #2
rajab natshahComment #4
rajab natshahComment #6
rajab natshahComment #7
rajab natshahComment #8
rajab natshahComment #9
rajab natshahComment #10
rajab natshahComment #11
rajab natshahComment #12
rajab natshahHaving the following yarn script commands
Two points
Comment #13
rajab natshahComment #14
rajab natshahComment #16
rajab natshahChanged after a discussion with Jose
on his work for https://github.com/Vardot/varbase-project
Vartheme BS4 base theme
VARTHEME_BS4_SUBTHEME
Comment #18
rajab natshahComment #19
rajab natshahComment #20
rajab natshahComment #21
rajab natshahComment #22
rajab natshahComment #23
rajab natshahComment #24
rajab natshahComment #27
rajab natshah