Problem/Motivation

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

#3112166: Drupal 9 compatible for [Varbase Total Control Dashboard] 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 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

RajabNatshah created an issue. See original summary.

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

Assigned: Unassigned » Mohammed J. Razem
Status: Active » Needs review
Issue tags: +varbase-8.8.7

For the 8.x-6.x-dev branch

The inline commands

rajab@vardot-dev:/var/www/html/products/varbase_total_control$ 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/
rajab@vardot-dev:/var/www/html/products/varbase_total_control$ 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/

yarn phpcs

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

FILE: /var/www/html/products/varbase_total_control/css/theme/varbase-total-control.theme.css
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------------------

Time: 368ms; Memory: 8MB

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn phpcbf

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

No fixable errors were found

Time: 155ms; Memory: 8MB

Done in 0.24s.

yarn eslint

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

yarn stylelint

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

Version: 8.x-6.x-dev » 9.0.x-dev
Assigned: Mohammed J. Razem » Rajab Natshah
Status: Needs review » Active

  • RajabNatshah committed 2c8aad0 on 9.0.x
    Issue #3175492: Add yarn script commands for Drupal coding standard and...

  • RajabNatshah committed 8b2c5e7 on 9.0.x
    Issue #3175492: 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-9.0.0

For the 9.0.x branch

gulp compile

rajab@vardot-dev:/var/www/html/products/varbase_total_control$ gulp compile
[16:13:32] Using gulpfile /var/www/html/products/varbase_total_control/gulpfile.js
[16:13:32] Starting 'compile'...
[16:13:33] Finished 'compile' after 155 ms

The inline commands

rajab@vardot-dev:/var/www/html/products/varbase_total_control$ 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/
rajab@vardot-dev:/var/www/html/products/varbase_total_control$ 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/

yarn phpcs

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

FILE: /var/www/html/products/varbase_total_control/css/theme/varbase-total-control.theme.css
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------------------

Time: 152ms; Memory: 8MB

error Command failed with exit code 1.

yarn phpcbf

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

No fixable errors were found

Time: 153ms; Memory: 8MB

Done in 0.23s.

yarn eslint

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

yarn stylelint

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

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

Version: 9.0.x-dev » 8.x-6.x-dev
Rajab Natshah’s picture

Status: Needs review » Fixed
Rajab Natshah’s picture

Rajab Natshah’s picture

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.