Problem/Motivation

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

#3113172: Drupal 9 compatibility for [Varbase Email] 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 Email Drupal coding standard

phpcbf --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/node_modules/

phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/node_modules/

Check Varbase Email Drupal Practice

phpcbf --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/node_modules/

phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/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

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

  • RajabNatshah committed 195ff21 on 8.x-6.x
    Issue #3173376: Add yarn script commands for Drupal coding standard and...
  • RajabNatshah committed 80a6eb4 on 8.x-6.x
    Issue #3173376: Add yarn script commands for Drupal coding standard and...
rajab natshah’s picture

Assigned: rajab natshah » mohammed j. razem
Status: Active » Needs review
Issue tags: +varbase-8.8.7, +varbase-9.0.0

The inline commands

rajab@vardot-dev:/var/www/html/products/varbase_email$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/node_modules/
rajab@vardot-dev:/var/www/html/products/varbase_email$ phpcbf --standard=Drupal --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/node_modules/

No fixable errors were found

Time: 942ms; Memory: 8MB
rajab@vardot-dev:/var/www/html/products/varbase_email$ phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,theme,scss,css,info,txt,md,yml /var/www/html/products/varbase_email/ --ignore=/var/www/html/products/varbase_email/node_modules/

yarn phpcs

rajab@vardot-dev:/var/www/html/products/varbase_email$ yarn phpcs
yarn run v1.22.5
$ phpcs --standard=./.phpcs.xml .
Done in 0.21s.

yarn phpcbf

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

No fixable errors were found

Time: 67ms; Memory: 8MB

Done in 0.15s.

yarn eslint

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

yarn stylelint

rajab@vardot-dev:/var/www/html/products/varbase_email$ yarn stylelint
yarn run v1.22.5
$ npx stylelint --config=.stylelintrc.json --syntax html .

templates/varbase_emails.html.twig
 59:25  ✖  Unknown word   CssSyntaxError

error Command failed with exit code 2.

The issue 59:25 ✖ Unknown word CssSyntaxError
It's the direction: {{ dir }}; in the twig file
https://git.drupalcode.org/project/varbase_email/-/blob/8.x-6.x/template...

rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue tags: +varbase-9.0.0-alpha1

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.