Are you looking to implement YAML lint in TYPO3? For better TYPO3 code quality, To save your productive time, It’s always good practice to check TYPO3 Lint code, Let’s learn how! Always pass your TYPO3 YAML code with below lint.
Step 1. Install and Configure YAML Lint
// Install Python-PIP
apt install python-pip
// Install Python based YAMLINT
pip install yamllint
Step 2. Prepare .yamllint.yml
extends: default
rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1
colons:
level: warning
commas:
level: warning
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
level: warning
hyphens:
level: warning
indentation:
spaces: 2
level: warning
indent-sequences: consistent
line-length: disable
truthy: disable
ignore: |
/.ddev/
Step 3. Code Review Your YAML Code
// Run YAML Lint
yamllint -c .yamllint.yml .
Post a Comment