Skip to main content

Fast YAML linter inspired by yamllint

Project description

ryl

ryl - the Rust Yaml Linter is intended to ultimately be a drop in replacement for yamllint. It is usable today, but parity and edge-case behavior are still maturing.

Compatibility note:

  • ryl aims to match yamllint behavior and includes many parity tests.
  • ryl uses the saphyr parser stack, while yamllint uses the PyYAML parser stack.
  • saphyr and PyYAML do not always agree on which files are valid YAML.

Quick Start

# Using uv (Python)
uvx ryl .

# Using npx (Node.js)
npx @owenlamont/ryl .

For prek / pre-commit integration, see ryl-pre-commit.

Installation

uv

uv tool install ryl

NPM

npm install -g @owenlamont/ryl

pip

pip install ryl

Cargo

cargo install ryl

Usage

ryl accepts one or more paths: files and/or directories.

Basic:

ryl <PATH_OR_FILE> [PATH_OR_FILE...]

Behavior:

  • Files: parsed as YAML even if the extension is not .yml/.yaml.
  • Directories: recursively lints .yml and .yaml files.
    • Respects .gitignore, global git ignores, and git excludes.
    • Does not follow symlinks.

Exit codes:

  • 0 when all parsed files are valid (or no files found).
  • 1 when any invalid YAML is found.
  • 2 for CLI usage errors (for example, no paths provided).

Examples:

# Single file
ryl myfile.yml

# Multiple inputs (mix files and directories)
ryl config/ another.yml

# Multiple directories
ryl dir1 dir2

# Explicit non-YAML extension (parsed as YAML)
ryl notes.txt

Help and version:

Fast YAML linter written in Rust

Usage: ryl [OPTIONS] [PATH_OR_FILE]...

Arguments:
  [PATH_OR_FILE]...  One or more paths: files and/or directories

Options:
  -c, --config-file <FILE>           Path to configuration file (YAML or TOML)
  -d, --config-data <YAML>           Inline configuration data (yaml)
  -f, --format <FORMAT>              Output format (auto, standard, colored, github,
                                     parsable) [default: auto]
                                     [possible values: auto, standard, colored,
                                     github, parsable]
      --fix                          Apply safe fixes in place before reporting
                                     remaining diagnostics
      --migrate-configs              Convert discovered legacy YAML config files
                                     into .ryl.toml files
      --list-files                   List files that would be linted (reserved)
  -s, --strict                       Strict mode (reserved)
      --no-warnings                  Suppress warnings (reserved)
      --migrate-root <DIR>           Root path to search for legacy YAML config
                                     files (default: .)
      --migrate-write                Write migrated .ryl.toml files (otherwise
                                     preview only)
      --migrate-stdout               Print generated TOML to stdout during migration
      --migrate-rename-old <SUFFIX>  Rename source YAML configs by appending
                                     this suffix after migration
      --migrate-delete-old           Delete source YAML configs after migration
  -h, --help                         Print help
  -V, --version                      Print version

Performance benchmarking

This repo includes a standalone benchmark script that compares PyPI ryl and yamllint using synthetic YAML corpora and hyperfine.

Prerequisites:

  • uv
  • hyperfine

Run a quick sample:

uv run scripts/benchmark_perf_vs_yamllint.py --file-counts 25,100 --file-sizes-kib 1,8 --runs 5 --warmup 1

Run a fuller matrix (explicit lists):

uv run scripts/benchmark_perf_vs_yamllint.py --file-counts 25,100,400,1000 --file-sizes-kib 1,8,32,128 --runs 10 --warmup 2

Run a fuller matrix (ranges with increments):

uv run scripts/benchmark_perf_vs_yamllint.py --file-count-start 100 --file-count-end 1000 --file-count-step 100 --file-size-start-kib 4 --file-size-end-kib 64 --file-size-step-kib 4 --runs 10 --warmup 2

The script uses Typer; use --help for all options.

Artifacts are written under manual_outputs/benchmarks/<UTC_TIMESTAMP>/:

  • benchmark.png and benchmark.svg: side-by-side facet plot with shared Y axis.
  • summary.csv: aggregated timing table.
  • meta.json: tool versions and run parameters.
  • hyperfine-json/: raw results from hyperfine.

Example benchmark figure (5x5 matrix, 5 runs per point):

Benchmark: ryl vs yamllint scaling (5x5 matrix, 5 runs per point)

Configuration

  • Flags:
    • -c, --config-file <FILE>: path to a YAML or TOML config file.
    • -d, --config-data <YAML>: inline YAML config (highest precedence).
    • --fix: apply safe fixes in place before reporting remaining diagnostics.
    • --list-files: print files that would be linted after applying ignores and exit.
    • --migrate-configs: discover legacy YAML configs and plan TOML migration.
    • --migrate-root <DIR>: root to search for legacy YAML configs (default .).
    • --migrate-write: write migrated .ryl.toml files (without this it is preview-only).
    • --migrate-stdout: print generated TOML in migration mode.
    • --migrate-rename-old <SUFFIX>: rename discovered legacy YAML config files after writing.
    • --migrate-delete-old: delete discovered legacy YAML config files after writing.
    • -f, --format, -s, --strict, --no-warnings: reserved for compatibility.
  • Discovery precedence: inline --config-data > --config-file > env YAMLLINT_CONFIG_FILE (global) > nearest project config up the tree: TOML (.ryl.toml, ryl.toml, pyproject.toml with [tool.ryl]) then YAML fallback (.yamllint, .yamllint.yml, .yamllint.yaml)

    user-global ($XDG_CONFIG_HOME/yamllint/config or ~/.config/yamllint/config) > built-in defaults.

  • Rules Documentation: see docs/rules.md for a full list of supported rules and their fixable status.
  • TOML and YAML are not merged during discovery. If a TOML project config is found, YAML project config discovery is skipped (and ryl prints a warning).
  • Native fix policy is TOML-only. YAML config remains yamllint-compatible and does not support fix settings.
  • Per-file behavior: unless a global config is set via --config-data, --config-file, or YAMLLINT_CONFIG_FILE, each file discovers its nearest project config. Ignores apply to directory scans and explicit files (parity).
  • Presets and extends: supports yamllint’s built-in default, relaxed, and empty via extends. Rule maps are deep-merged; scalars/sequences overwrite.
  • TOML preset examples: see docs/config-presets.md for default/relaxed equivalents.

Example TOML config (.ryl.toml):

yaml-files = ["*.yaml", "*.yml"]
ignore = ["vendor/**", "generated/**"]
locale = "en_US.UTF-8"

[rules]
document-start = "disable"

[rules.line-length]
max = 120

[rules.truthy]
allowed-values = ["true", "false"]

[fix]
fixable = ["ALL"]
unfixable = []

Migration example:

# Preview migration actions
ryl --migrate-configs --migrate-root .

# Write .ryl.toml files and keep old files with a suffix
ryl --migrate-configs --migrate-root . --migrate-write --migrate-rename-old .bak

Acknowledgements

This project exists thanks to the tooling and ecosystems around YAML linting and developer automation, especially:

  • yamllint - for giving me the shoulders to stand on and the source of many of the automated tests that ryl uses now to check for behaviour parity. Copying the behaviour of an existing tool is infinitely easier than building one from scratch - there'd be no ryl without yamllint.
  • ruff - for showing the power of Rust tooling for Python development and inspiring the config and API for ryl.
  • rumdl - for giving me another template to follow for Rust tooling and showing me almost the only dev tool I was still using after this that wasn't written in Rust was yamllint (which inspired me to tackle this project)
  • saphyr - ryl is built on saphyr and saphyr's developers were very patient in showing some of the nuance and complexity of parsing YAML which I was embarrassingly ignorant of when start ryl.
  • esbuild and biome - for providing the "binary wrapper" blueprint for distributing high-performance native tools via NPM.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ryl-0.5.0.tar.gz (186.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ryl-0.5.0-py3-none-win_arm64.whl (2.7 MB view details)

Uploaded Python 3Windows ARM64

ryl-0.5.0-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

ryl-0.5.0-py3-none-musllinux_1_2_x86_64.whl (3.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

ryl-0.5.0-py3-none-musllinux_1_2_aarch64.whl (3.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

ryl-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ryl-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

ryl-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (4.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

ryl-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

ryl-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

ryl-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ryl-0.5.0-py3-none-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file ryl-0.5.0.tar.gz.

File metadata

  • Download URL: ryl-0.5.0.tar.gz
  • Upload date:
  • Size: 186.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ryl-0.5.0.tar.gz
Algorithm Hash digest
SHA256 07ef7d7616a12becdb3afe4e5019bb3750d95d59a5d8b68728a67f32901ae3ba
MD5 a599d8ac70e30ca7a568a18c3a8692fe
BLAKE2b-256 cfbc023c65897bc381fa4199740ed1a760d266242d8c7742eec05e9ca2fc5425

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0.tar.gz:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: ryl-0.5.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ryl-0.5.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 7992721fd7d262a74b6bd571513c95e6bd3429a89028277933b04a672be65d4a
MD5 a66f35f423be6143d8380d54960b46fb
BLAKE2b-256 be77291d05c3dcd5cf560b36e2133ff82b43f3409f6cfc5ed127f446e50cdaa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-win_arm64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: ryl-0.5.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ryl-0.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f49342c895b3f4c2b6dcf0d0c152a69ea69507655c3b6da7e65bf5d22c4b07a8
MD5 e73c8015352731a2df6ed459f9bedc33
BLAKE2b-256 1183e92ee0b42b1ce6bb58a37e23e5335ff90137082738611115437c7874792f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-win_amd64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: ryl-0.5.0-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ryl-0.5.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1000f17d5eb1d455d65344283125841687c52d1daa0f2b60a0fc23eedbd86065
MD5 ea04f1d2d93ae8e2d225a975adf73124
BLAKE2b-256 436a4801a00eeed520d4261dc29d83d16cb0c612bf584b344b4b7f4942a70ab7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

  • Download URL: ryl-0.5.0-py3-none-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ryl-0.5.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e9607b187ff08d9afe3fa9c0babdafbe503a069fdfd82b6fcf19f3f8fdf34e1b
MD5 a838bda552f3e5d3a97e4ee50cdcc1f3
BLAKE2b-256 62f8b5605ef97f8e197852e28c55cbfecc490423f5015e1beefea01395adea11

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-musllinux_1_2_aarch64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ryl-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bfbf6612a47ca4f593c98285adb49c8a38c66a7e412cd4fa81703f0df9f5f6d9
MD5 6b8d23075645b636901e09661310a35c
BLAKE2b-256 5603c5f2319539410da6a1a2949003f3ae2c4a2f07df0e3c773b95a8e5c12f2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for ryl-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 ac8553b3f5481f17626c5221b9e03b0a3c446cad91cdad079477b795a962f3d9
MD5 74c478f5010e87de5bab1b268a80ac73
BLAKE2b-256 8c233425f85f529862a11ecc1a387c013a491fbafed59259c35c230586c4f683

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for ryl-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 4c791d3eee27156c5838f9bfb6730a4a6626e77aa2a2e30c6f9a188febedfc5a
MD5 bd4607f1fd2e9f5b2e5940ace87285ff
BLAKE2b-256 ce50410aa66f9832654253014c3d94fd8a96ae34f2dfa8659c3445784e848b1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for ryl-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 69027676851eaf9e685c7131eaed0586f66f3bb2221411aa398f31b45a3ef25e
MD5 d37df9d1373dbfc19edc5887c4061328
BLAKE2b-256 8ae9504af585cbed2ce2f580d7800d17ff7d2a75771f67795536ae3aa396bcad

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ryl-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c3e0a9b3b0b0671d93ba7292f0016563b4239b31bef9a457c4bf4516c9cecc22
MD5 810879352894451f248efc0b28701a50
BLAKE2b-256 004206742e38a075ea7d4296b1926289df3d792f068c68767cc80327316d6717

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ryl-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a8ec3ca9c0036b6c7ccd7f79e3788b79d2f9cfe6c3de374a665aeecc6b880fbf
MD5 5479cbf4ec0755669dad50874a3ebbf0
BLAKE2b-256 56302bba07c03b0591826010d83749676bd3e3dd897dc6de7bd4e365c8ebce59

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ryl-0.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ryl-0.5.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ryl-0.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b614b110c179b2db29434ccc51a09be061913dde71c03a11190a062ed663bbe
MD5 bf595af5d745645d5b4cad0dee0b546b
BLAKE2b-256 38d5a8befbb02edb780792f869c2a9e5eb9d16d2c20eef76dd24cf88ea0fb611

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.5.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on owenlamont/ryl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page