ryl¶
A fast YAML linter and formatter, written in Rust¶
-
Built for speed
Written in Rust for fast lint runs across large YAML trees.
-
Configurable rules
Choose the YAML style checks your project needs and configure their options.
-
Auto-fixes
Apply safe automatic fixes for spacing, line endings, quoting, and more with
ryl check --fix, or format whole files withryl format. -
Easy to install
Single binary, distributed via Cargo, pip, npm, conda-forge, and winget. No runtime dependencies.
Quick start¶
# Install with Cargo
cargo install ryl
# Or with pip
pip install ryl
# Or with npm
npm install --global @owenlamont/ryl
# Or with conda (conda-forge)
pixi global install ryl
# Or with winget (Windows)
winget install owenlamont.ryl
# Lint with every rule, before adding a config (see Quick start)
ryl check --enable ALL .
# Format in place
ryl format .
YAML version compatibility¶
ryl reads YAML as 1.2: it parses with its own fork of
granit-parser and resolves a directive-less document per the YAML 1.2
core schema, while honouring an explicit %YAML version directive. By default it
writes output a YAML 1.1 reader also understands; target-version = "1.2" drops that.
See YAML version compatibility for how version directives
and implicit types affect linting and formatting.
Why ryl¶
ruff, ty, prek and rumdl replaced the Python linters and formatters in my own toolchain with fast Rust tools, leaving yamllint as the last one. ryl is its Rust replacement, modelled on those tools.
ryl combines configurable lint rules, safe fixes, and whole-file formatting. TOML configuration supports per-file rule selection, and SchemaStore helps editors validate that configuration.
Coming from yamllint or another YAML formatter? See the guides for yamllint and formatter configurations.
Next steps¶
-
Cargo, pip, npm, or a prebuilt binary.
-
Lint a project in under a minute.
-
Every rule, with examples and fixable status.
-
defaultandrelaxedas TOML or YAML, plus the YAML-onlyempty.