Type object
File match **/.yamllint **/.yamllint.yaml **/.yamllint.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/yamllint/latest.json
Source https://www.schemastore.org/yamllint.json

Validate with Lintel

npx @lintel/lintel check
Type: object

yamllint uses a set of rules to check YAML source files for problems.

Properties

extends string

When writing a custom configuration file, you don’t need to redefine every rule. Just extend the default configuration (or any already-existing configuration file).

Default: "default"
Examples: "default", "relaxed"
yaml-files string[]

To configure what yamllint should consider as YAML files when listing directories, set yaml-files configuration option.

Default:
[
  "*.yaml",
  "*.yml",
  ".yamllint"
]
locale string

This is passed to Python's locale.setlocale.

Examples: "en_US.UTF-8"
rules object

When linting a document with yamllint, a series of rules are checked against. A configuration file can be used to enable or disable these rules, to set their level (error or warning), but also to tweak their options.

23 nested properties
anchors toggle | object

Use this rule to report duplicated anchors and aliases referencing undeclared anchors.

Default: "enable"
braces toggle | object

Use this rule to control the use of flow mappings or number of spaces inside braces ({ and }).

Default: "enable"
brackets toggle | object

Use this rule to control the use of flow sequences or the number of spaces inside brackets ([ and ]).

Default: "enable"
colons toggle | object

Use this rule to control the number of spaces before and after colons (:).

Default: "enable"
commas toggle | object

Use this rule to control the number of spaces before and after commas (,).

Default: "enable"
comments toggle | object

Use this rule to control the position and formatting of comments.

Default:
{
  "level": "warning"
}
comments-indentation toggle | rule

Use this rule to force comments to be indented like content.

Default:
{
  "level": "warning"
}
document-end toggle | object

Use this rule to require or forbid the use of document end marker (...).

Default: "disable"
document-start toggle | object

Use this rule to require or forbid the use of document start marker (---).

Default:
{
  "level": "warning"
}
empty-lines toggle | object

Use this rule to set a maximal number of allowed consecutive blank lines.

Default: "enable"
empty-values toggle | object

Use this rule to prevent nodes with empty content, that implicitly result in null values.

Default: "disable"
float-values toggle | object

Use this rule to limit the permitted values for floating-point numbers. YAML permits three classes of float expressions: approximation to real numbers, positive and negative infinity and "not a number".

Default: "disable"
hyphens toggle | object

Use this rule to control the number of spaces after hyphens (-).

Default: "enable"
indentation toggle | object

Use this rule to control the indentation.

Default: "enable"
key-duplicates toggle | object

Use this rule to prevent multiple entries with the same key in mappings.

Default: "enable"
key-ordering toggle | object

Use this rule to enforce alphabetical ordering of keys in mappings. The sorting order uses the Unicode code point number as a default. As a result, the ordering is case-sensitive and not accent-friendly (see examples below). This can be changed by setting the global locale option. This allows one to sort case and accents properly.

Default: "disable"
line-length toggle | object

Use this rule to set a limit to lines length.

Default: "enable"
new-line-at-end-of-file toggle | rule

Use this rule to require a new line character (\n) at the end of files.

The POSIX standard requires the last line to end with a new line character. All UNIX tools expect a new line at the end of files. Most text editors use this convention too.

Default: "enable"
new-lines toggle | object

Use this rule to force the type of new line characters.

Default: "enable"
octal-values toggle | object

Use this rule to prevent values with octal numbers. In YAML, numbers that start with 0 are interpreted as octal, but this is not always wanted. For instance 010 is the city code of Beijing, and should not be converted to 8.

Default: "disable"
quoted-strings toggle | object

Use this rule to forbid any string values that are not quoted, or to prevent quoted strings without needing it. You can also enforce the type of the quote used.

Default: "disable"
trailing-spaces toggle | rule

Use this rule to forbid trailing spaces at the end of lines.

Default: "enable"
truthy toggle | object

Use this rule to forbid non-explicitly typed truthy values other than allowed ones (by default: true and false), for example YES or off.

This can be useful to prevent surprises from YAML parsers transforming [yes, FALSE, Off] into [true, false, false] or {y: 1, yes: 2, on: 3, true: 4, True: 5} into {y: 1, true: 5}.

Depending on the YAML specification version used by the YAML document, the list of truthy values can differ. In YAML 1.2, only capitalized / uppercased combinations of true and false are considered truthy, whereas in YAML 1.1 combinations of yes, no, on and off are too. To make the YAML specification version explicit in a YAML document, a %YAML 1.2 directive can be used (see example below).

Default:
{
  "level": "warning"
}

Definitions

ignorable object
ignore string | array
ignore-from-file string | array
rule object
ignore string | array
ignore-from-file string | array
toggle enum | boolean