Problem/Motivation

Saving time on checking standards and practice before committing any code.

#3113113: Drupal 9 compatibility for [Varbase distribution] installation profile with Drupal coding standard and practice


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

RajabNatshah created an issue. See original summary.

Rajab Natshah’s picture

Issue summary: View changes

  • RajabNatshah committed d4b88c1 on 8.x-8.x
    Issue #3176371: Add yarn script commands for Drupal coding standard and...

  • RajabNatshah committed 0dc7aef on 9.0.x
    Issue #3176371: Add yarn script commands for Drupal coding standard and...

  • RajabNatshah committed abf12da on 8.x-8.x
    Issue #3176371: Add yarn script commands for Drupal coding standard and...
Rajab Natshah’s picture

...

Rajab Natshah’s picture

Assigned: Rajab Natshah » Mohammed J. Razem
Status: Active » Needs review
Issue tags: +varbase-8.8.7, +varbase-9.0.0

yarn phpcs

rajab@vardot-dev:/var/www/html/products/varbase$ yarn phpcs
yarn run v1.22.5
$ phpcs --standard=./.phpcs.xml .
Time: 420ms; Memory: 12MB

yarn phpcbf

rajab@vardot-dev:/var/www/html/products/varbase$ yarn phpcbf
yarn run v1.22.5
$ phpcbf --standard=./.phpcs.xml .

No fixable errors were found

Time: 414ms; Memory: 12MB

Done in 0.51s.

yarn eslint

rajab@vardot-dev:/var/www/html/products/varbase$ yarn eslint
yarn run v1.22.5
$ node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json .
Done in 1.01s.

yarn stylelint

rajab@vardot-dev:/var/www/html/products/varbase$ yarn stylelint
yarn run v1.22.5
$ npx stylelint --config=.stylelintrc.json .
Done in 4.48s.
Rajab Natshah’s picture

Assigned: Mohammed J. Razem » Unassigned
Rajab Natshah’s picture

Status: Needs review » Fixed
Rajab Natshah’s picture

Issue tags: +Drupal 9 compatibility
Rajab Natshah’s picture

Status: Fixed » Closed (fixed)