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]
      --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).
    • --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.

  • 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).
  • 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"]

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.4.4.tar.gz (177.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.4.4-py3-none-win_arm64.whl (2.7 MB view details)

Uploaded Python 3Windows ARM64

ryl-0.4.4-py3-none-win_amd64.whl (2.9 MB view details)

Uploaded Python 3Windows x86-64

ryl-0.4.4-py3-none-musllinux_1_2_x86_64.whl (3.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

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

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

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

Uploaded Python 3manylinux: glibc 2.17+ i686

ryl-0.4.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

ryl-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ryl-0.4.4-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.4.4.tar.gz.

File metadata

  • Download URL: ryl-0.4.4.tar.gz
  • Upload date:
  • Size: 177.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.4.4.tar.gz
Algorithm Hash digest
SHA256 411fbdc298a0a92faea31e7cf99bb1e2541b92b3bdff01f9634dab0642e10dd4
MD5 0595f1b393285bb494388c99bf849756
BLAKE2b-256 59f2d6ad38c5aea3ca624624dc4d8f2dbd111eaf896d09fe646b2003de4e357f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4.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.4.4-py3-none-win_arm64.whl.

File metadata

  • Download URL: ryl-0.4.4-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.4.4-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 c834b97e1bca6f5a745734a7422ee49dd079ee7cbcc5ccb766eebd9b1efb28db
MD5 a97604a5e27627be27894fe82756d8b5
BLAKE2b-256 0b5a833b5c5b0c507c122e1f2d475ab21d354a601464bea0be669d3a5890290e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-win_amd64.whl.

File metadata

  • Download URL: ryl-0.4.4-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.9 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.4.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 792f6a5b92440dfbc7fce2c759606d1bcdce2106ad62c9804864955b9306e645
MD5 0af4ea9b9c48659c3b23fab38abc0cf4
BLAKE2b-256 67dddd28ef1c98148aa26eafc19b9ac966abcc41313d27d03d19f9901ad0cc73

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: ryl-0.4.4-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 3.7 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.4.4-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2f364672764646734a70bd97a6bc566b8ea9f65d723ee989085b89012d682cba
MD5 c2c4f5a93f0d019e62a8612bea1eccfc
BLAKE2b-256 734b687ee0b85c70beb693cfdffd2e89a77590c265cb8a391fb95f844d256ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-musllinux_1_2_aarch64.whl.

File metadata

  • Download URL: ryl-0.4.4-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.4.4-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fad916fd0751968beba9aea9be14ef2a83ba76dfb5fef4f47bb9069bfdb74421
MD5 dfa6ab405e474919fd109be814cd895e
BLAKE2b-256 4399a6ca05327279c794442da5bf12512bb0cfea79606f1d4748af19d9f96236

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ryl-0.4.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4000e400ed339a01288e117903e46ec9c1fea51a03ad441a6d6bb614471d8578
MD5 120401b0155f64eaa24b70332efa3034
BLAKE2b-256 a25246930135d66d3354511edb31764a04550ceb014b5e306aca5f5292b7dee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for ryl-0.4.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 4fe0037a5e11d1025bcd7bd431f19ba8eda87b1ad44bee2fab8ac66723140910
MD5 c49257a9db7ae6f9701dbac93bd53af0
BLAKE2b-256 dc5944a4aaea9f9127c78952fbdf4344fc32e11a29ea21548cfcb88442dad49c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for ryl-0.4.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 c613d3f863e0cc7a32b56daadf6fcf83880127fa87dfbada3d0e8b24eb6a3885
MD5 d4b5b0c9af1d2422dcdbd0086b6582aa
BLAKE2b-256 586fe497c379d9a79749aeae419e1efb26fd05133f9acf0acce2a50f92748dc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for ryl-0.4.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 90d1a15b67e5c32954063a43372e609a0a9106ef99fe4378740cdf93de1b35c9
MD5 f7af473d0dc48758acbd616972a08135
BLAKE2b-256 8d070a50f2b16e8dfe8f4500ee6e883d8c35b2e334f12e07265b0ba8bf12851a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ryl-0.4.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 df93349b72fa2cf05e6a2ae8e8c93143e7b8ecf7a70d06c22a0cf36985efc587
MD5 87a9862bdae95851f8b226675d4fa86b
BLAKE2b-256 53b64cc0f0f2dc31427559a87e93b8170226ac7ed44f999c1802d27dd9c391d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ryl-0.4.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 220b3f7d11fee65e02e4093721ddc4dd97169889df505295a22f29eb3930f1d2
MD5 7e6950c6fb23b411804c754d122c598e
BLAKE2b-256 e6fd81b04a8ceb15ca9f91d172861f6c47796c71b9d2a0af94feaa9c08f0696f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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.4.4-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ryl-0.4.4-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.4.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f7b9bd21bf0bfa29eba3a31de7b35ad7d2e0aa37aa88176fd559d09ce47b6f0
MD5 3ac5ea16dc81dbaf008f995acabf4b21
BLAKE2b-256 97b709066ef6d15339f74a5ed706fb884e6a903e49287ce0e62f2eb29c500078

See more details on using hashes here.

Provenance

The following attestation bundles were made for ryl-0.4.4-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