How to Automize YAML Lint in TYPO3?

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

×
Captcha Code Can't read the image? Click here to refresh
  • user
    sonal July 25, 2020 at 12:45 pm
    It's really useful!

Got answer to the question you were looking for?