A linter for YAML files.
Project Links
Meta
Author: Adrien Vergé
Requires Python: >=3.9
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Console
Intended Audience
- Developers
License
- OSI Approved :: GNU General Public License v3 (GPLv3)
Programming Language
- Python
Topic
- Software Development
- Software Development :: Debuggers
- Software Development :: Quality Assurance
- Software Development :: Testing
A linter for YAML files.
yamllint does not only check for syntax validity, but for weirdnesses like key repetition and cosmetic problems such as lines length, trailing spaces, indentation, etc.
Written in Python (compatible with Python 3 only).
Documentation
Overview
Screenshot

Installation
Using pip, the Python package manager:
pip install --user yamllint
yamllint is also packaged for all major operating systems, see installation examples (dnf, apt-get…) in the documentation.
Usage
# Lint one or more files
yamllint my_file.yml my_other_file.yaml ...
# Lint all YAML files in a directory
yamllint .
# Use a pre-defined lint configuration
yamllint -d relaxed file.yaml
# Use a custom lint configuration
yamllint -c /path/to/myconfig file-to-lint.yaml
# Output a parsable format (for syntax checking in editors like Vim, emacs...)
yamllint -f parsable file.yaml
Features
Here is a yamllint configuration file example:
extends: default
rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 80
level: warning
# don't bother me with this rule
indentation: disable
Within a YAML file, special comments can be used to disable checks for a single line:
This line is waaaaaaaaaay too long # yamllint disable-line
or for a whole block:
# yamllint disable rule:colons
- Lorem : ipsum
dolor : sit amet,
consectetur : adipiscing elit
# yamllint enable
Specific files can be ignored (totally or for some rules only) using a .gitignore-style pattern:
# For all rules
ignore: |
*.dont-lint-me.yaml
/bin/
!/bin/*.lint-me-anyway.yaml
rules:
key-duplicates:
ignore: |
generated
*.template.yaml
trailing-spaces:
ignore: |
*.ignore-trailing-spaces.yaml
/ascii-art/*
License
May 04, 2025
1.37.1
Mar 23, 2025
1.37.0
Mar 17, 2025
1.36.2
Mar 15, 2025
1.36.1
Mar 11, 2025
1.36.0
Feb 16, 2024
1.35.1
Feb 15, 2024
1.35.0
Feb 06, 2024
1.34.0
Nov 09, 2023
1.33.0
May 22, 2023
1.32.0
Apr 21, 2023
1.31.0
Mar 22, 2023
1.30.0
Jan 10, 2023
1.29.0
Sep 12, 2022
1.28.0
Jul 08, 2022
1.27.1
Jul 08, 2022
1.27.0
Aug 21, 2021
1.26.3
Aug 03, 2021
1.26.2
Apr 06, 2021
1.26.1
Jan 29, 2021
1.26.0
Sep 29, 2020
1.25.0
Jul 16, 2020
1.24.2
Jul 15, 2020
1.24.1
Jul 15, 2020
1.24.0
Apr 17, 2020
1.23.0
Apr 15, 2020
1.22.1
Apr 13, 2020
1.22.0
Mar 24, 2020
1.21.0
Dec 26, 2019
1.20.0
Nov 19, 2019
1.19.0
Oct 15, 2019
1.18.0
Aug 12, 2019
1.17.0
Jun 07, 2019
1.16.0
Feb 11, 2019
1.15.0
Jan 14, 2019
1.14.0
Nov 14, 2018
1.13.0
Oct 17, 2018
1.12.1
Oct 04, 2018
1.12.0
Apr 06, 2018
1.11.1
Feb 21, 2018
1.11.0
Nov 05, 2017
1.10.0
Oct 16, 2017
1.9.0
Oct 10, 2017
1.8.2
Jul 04, 2017
1.8.1
Jun 28, 2017
1.8.0
Apr 25, 2017
1.7.0
Feb 25, 2017
1.6.1
Nov 30, 2016
1.6.0
Oct 08, 2016
1.5.0
Sep 27, 2016
1.4.1
Sep 19, 2016
1.4.0
Jun 28, 2016
1.3.2
Jun 28, 2016
1.3.1
Jun 27, 2016
1.3.0
Jun 24, 2016
1.2.2
Mar 25, 2016
1.2.1
Mar 06, 2016
1.2.0
Mar 04, 2016
1.1.0
Mar 04, 2016
1.0.4
Feb 25, 2016
1.0.3
Feb 24, 2016
1.0.2
Feb 19, 2016
1.0.1
Feb 19, 2016
1.0.0
Feb 05, 2016
0.7.2
Feb 03, 2016
0.7.1
Feb 01, 2016
0.7.0
Jan 25, 2016
0.6.0
Jan 24, 2016
0.5.2
Jan 24, 2016
0.5.1
Jan 23, 2016
0.5.0
Jan 20, 2016
0.4.0
Jan 15, 2016
0.2.0
Jan 12, 2016
0.1.0