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:yamland update packages inpackage.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-9.0.2, varbase_carousels-9.0.1
User interface changes
- None
API changes
- None
Data model changes
- None
Comments
Comment #3
rajab natshahphpcs --standard=Drupal
phpcs --standard=DrupalPractice
yarn phpcs
yarn phpcbf
yarn lint:yaml
Comment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahComment #8
rajab natshahComment #9
rajab natshahComment #10
rajab natshah