• Stars
    star
    2,847
  • Rank 15,968 (Top 0.4 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A linter for YAML files.

yamllint

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.

CI tests status Code coverage status Documentation status

Written in Python (compatible with Python 3 only).

Documentation

https://yamllint.readthedocs.io/

Overview

Screenshot

yamllint 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

Read more in the complete documentation!

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/*

Read more in the complete documentation!

License

GPL version 3

More Repositories

1

openfortivpn

Client for PPP+TLS VPN tunnel services
Perl
2,605
star
2

PhotoCollage

Graphical tool to make photo collage posters
Python
374
star
3

localstripe

A fake but stateful Stripe server that you can run locally, for testing purposes.
Python
192
star
4

familytreemaker

Generates a family tree graph from a simple text file
Python
179
star
5

kijijiapi

Robot to post ads on Kijiji
Python
65
star
6

gnome-magic-window

Bind a key to a specific program in Gnome Shell.
JavaScript
26
star
7

coucharchive

Create and restore backups of a whole CouchDB server, with simple tar.gz files
Python
14
star
8

copr-couchdb

Unofficial CouchDB 3 RPM packages for Fedora and EPEL
Shell
10
star
9

arm-analyser

ARM binaries analyser
C
7
star
10

copr-some-nice-fonts

Some nice fonts including Arial, Courier New, Helvetica, etc. for Fedora and CentOS
6
star
11

vim-python-logging

Vim plugin to color logs generated by python-logging
Vim Script
4
star
12

keyboard-stickers

Localize your keyboard!
Python
4
star
13

rhythmbox_playlist_to_m3u

Converts playlists stored by Rhythmbox to M3U files
Python
3
star
14

posix-read

Do POSIX read on files and sockets with Node.js
C++
3
star
15

dotfiles

Shell
3
star
16

libcoresightomap4430

Use STM and ETB hardware tracing modules on OMAP4430 SoC
C
2
star
17

mousemode

C
2
star
18

copr-oauth2_proxy

Fedora & CentOS packages for oauth2_proxy (previously Google Auth Proxy)
1
star
19

context_unnester

Fixes Python source code that use contextlib.nested.
Python
1
star
20

copr-python37

Unofficial Python 3.7 packages for CentOS 7
1
star
21

textree

Jade-like syntax processor that allows easy writing of HTML or XML files with auto-templating and Javascript-based scripting features
JavaScript
1
star
22

find-duplicate-images

Search similar images in a list of files or directories
Python
1
star
23

nest-css

Script to nest all rules of a CSS document inside an arbitrary selector
Python
1
star