A linter for YAML files
open sourceGPL-3.0-or-laterfree
yamllint is Adrien Vergé's linter for YAML files, written in Python: beyond checking that a file parses, it catches oddities such as repeated keys and cosmetic problems such as long lines, trailing spaces and inconsistent indentation. It lints files or whole directories, comes with default and relaxed presets or your own configuration file, and has a parsable output format for editors such as Vim and Emacs. It installs with pip or from the major operating systems' packages.
Ways to install
Package managers
Problems it solves
- catch duplicate keys and indentation mistakes in my YAML files in CI
- lint Kubernetes or Ansible YAML before committing
- enforce a consistent YAML style across a repository
Features
- checks YAML syntax, repeated keys and cosmetic problems
- line length, trailing space and indentation rules
- default and relaxed presets or custom configuration
- parsable output for editors
Alternatives
The same job
These do what yamllint does.
- ansible-lint Checks playbooks for practices and behavior that could potentially be improved
- Vale A markup-aware linter for prose
- KubeLinter Static analysis for Kubernetes YAML files and Helm charts
- actionlint Static checker for GitHub Actions workflow files
- RuboCop RSpec RuboCop extension with cops for RSpec test files
- SwiftLint Linter that enforces Swift style and conventions, with auto-fix
