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
Compiling Provided Component Styles
In case of wanting to add a new feature or fix a bug in styling for a selected Varbase component.
Get Needed Yarn Development Dependencies
yarn install
Initialize
Initialize the gulp SASS files styling method. Run this only ones for each newly cloned project.
yarn theme:init
Theme Build
Compile source .scss files to .css files. Needs to compile manually on demand.
yarn theme:build
Watch
Watch source .scss files and compile them on saving to .css files. Auto compiling on save of changes for the source.
yarn theme:watch
After any change of code please check the standards before uploading a patch or creating a MR.
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
Linting JavaScript files
Check all JavaScript .js, .json files with Drupal standard scripting format.
yarn lint:js
Linting Styling
Check all styling .css files with Drupal standard styling format and order.
yarn lint:css
"scripts": { "theme:init": "gulp", "theme:build": "gulp compile", "theme:watch": "gulp watch", "phpcs": "phpcs --standard=./.phpcs.xml .", "phpcbf": "phpcbf --standard=./.phpcs.xml .", "lint:yaml": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json --ext .yml .", "lint:js": "node ./node_modules/eslint/bin/eslint.js --config=.eslintrc.json --ext .js .", "lint:css": "npx stylelint --config=.stylelintrc.json ." },
Remaining tasks
- ✅ File an issue about this project
- ✅ Add
lint:yaml
and 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.3 , varbase_media-9.0.4
User interface changes
- None
API changes
- None
Data model changes
- None
Comments
Comment #2
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #4
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedphpcs --standard=Drupal
phpcs --standard=DrupalPractice
yarn phpcs
yarn phpcbf
yarn lint:yaml
yarn lint:js
yarn lint:css
Comment #5
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #9
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #10
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #11
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commented