Problem/Motivation

Standard check and linting tools are outdated.
And a new linting tool with yarn lint:yaml was added to Drupal core
#2591827: Add YAML linting to core coding standards checks

Very important to make sure that all .yml files are in the right format.
eslint-plugin-yml a good tool to lint with
Example: using not standard format
or check on any duplicate yaml elements

Proposed resolution

Add the yarn lint:yaml
and update all outdated check configs and the package.json file

Get Needed Yarn Development Dependencies
yarn install

Check Standards/Practice Coding And Linting

Check Drupal Standard And Practice Coding
Check Drupal standard and practice coding.
yarn phpcs


PHP Code Beautifier and Fixer
Fix many errors and warnings automatically.
yarn phpcbf
Linting YAML files
Check all .yml files with Drupal standard yaml format.
yarn lint:yaml
  "scripts": {
    "phpcs": "phpcs --standard=./.phpcs.xml .",
    "phpcbf": "phpcbf --standard=./.phpcs.xml .",
    "lint:yaml": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json --ext .yml ."
  },


Remaining tasks

  • ✅ File an issue about this project
  • ✅ Add lint:yaml and update packages in package.json
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ✅ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release varbase_commerce-1.0.0-alpha1

User interface changes

  • None

API changes

  • None

Data model changes

  • None

Comments

RajabNatshah created an issue. See original summary.

  • RajabNatshah committed 9ae666d on 1.0.x
    Issue #3238437: Add lint:yaml and update the package.json for Varbase...
rajab natshah’s picture

Assigned: rajab natshah » mohammed j. razem
Issue summary: View changes
Status: Active » Needs review
Issue tags: +varbase-9.0.2, +varbase_commerce-1.0.0-alpha1

phpcs --standard=Drupal

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

phpcs --standard=DrupalPractice

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

yarn phpcs

rajab@vardot-dev:/var/www/html/products/varbase_commerce$ yarn phpcs
yarn run v1.22.10
$ phpcs --standard=./.phpcs.xml .
Done in 0.40s.

yarn phpcbf

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

No fixable errors were found

Time: 235ms; Memory: 10MB

Done in 0.33s.

yarn lint:yaml

rajab@vardot-dev:/var/www/html/products/varbase_commerce$ yarn lint:yaml
yarn run v1.22.10
$ node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json --ext .yml .
Done in 4.37s.
rajab natshah’s picture

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

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes