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

uvx ryl .

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

Installation

uv

uv tool install 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:

  • ryl -h or ryl --help shows auto-generated help.
  • ryl -V or ryl --version prints the version.

The CLI is built with clap, which auto-generates --help and --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 config file.
    • -d, --config-data <YAML>: inline YAML config (highest precedence).
    • --list-files: print files that would be linted after applying ignores and exit.
    • -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 (.yamllint, .yamllint.yml, .yamllint.yaml) > user-global ($XDG_CONFIG_HOME/yamllint/config or ~/.config/yamllint/config) > built-in defaults.
  • 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.

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.

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.3.5.tar.gz (159.1 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.3.5-py3-none-win_arm64.whl (2.5 MB view details)

Uploaded Python 3Windows ARM64

ryl-0.3.5-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3Windows x86-64

ryl-0.3.5-py3-none-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

ryl-0.3.5-py3-none-musllinux_1_2_aarch64.whl (3.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

ryl-0.3.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ryl-0.3.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

ryl-0.3.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

ryl-0.3.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

ryl-0.3.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

ryl-0.3.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ryl-0.3.5-py3-none-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for ryl-0.3.5.tar.gz
Algorithm Hash digest
SHA256 59041b1fa94705cf8d23a0d3cd93d0866381caba7116eb6401ccff7693e9c568
MD5 565e8b9e24dda240e38639536c9ac617
BLAKE2b-256 c35bf6621adce30669ba6db3ea6895139056a8e76e52c56fe0341b87376b5027

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.3.5-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.5 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.3.5-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 79e5c9a1593f5048c56b03a8d4284332f2ba814d8f9b7ba42b47a783f4f8d55f
MD5 a9dc96536427778056e99b707d7e925e
BLAKE2b-256 d2a45f4efe260f9f5a9f33577cf29f6567a1a35d5304450a4968681f208ac466

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.3.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.7 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.3.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f37b137556143fd23e571bed5231fde98e7226fbe4bc57db517a49d3024f8c87
MD5 2b567d8a28d7620686c8008bbbeb7c36
BLAKE2b-256 4e72c2206eab893636c1132bff47441ed3381016219f154e7bc0a80b9e2a578a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.3.5-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 3.4 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.3.5-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c43163ab17de74701e5015faa49b0b128fc970b3c83de6b2fd0f54eb4595435e
MD5 c91b356527aaf3dc1c4e34e02ff3cd21
BLAKE2b-256 8407d3ca225a2cdb65c1179c5898ec1532f0c2fcc5e55bb77e0346c82a1079fa

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.3.5-py3-none-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 3.2 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.3.5-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 733f6da9a26f1507b529117d0b692d82a8df35fde0ce7d1552c5d6a1087fcf8a
MD5 2a6d1365e19bd9826964a3e99227da16
BLAKE2b-256 64dbb39b5b4eace9d36c26757c96e37c7e77fc5cbf17b21521fd0e4d26df4e2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.3.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0b3abd42aeb4aacd8890e351157b4af9f029c78d170b59a31663638cc7d4570
MD5 3b7ed1b019bb788340cc89038478a456
BLAKE2b-256 86bfac0e1ac5c2bb4f5b86952205edd3b24d43937bfb3560b904e1bfc1000e14

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.3.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 bd73faa62869a1081a8e9a643402471e67e0ec93d14b6d84fc33898993900063
MD5 b3e4ba465ad692ccd3233e3847d55a9a
BLAKE2b-256 ae1dfa1a4e1290d4617a69c91cde021247cd2601886723e12bb9969d85065f8b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.3.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 985d85cc24d4097eb6bd99dee817bc75b8aed60900b6c39ef43113ddf042a0aa
MD5 80d8641ce74969f541794bf03d55ffa1
BLAKE2b-256 637eab300f573f4de13b11c9d7971cb4875d62a9e983d410587a8225b9dc57ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.3.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 51ae4dfe4682c19d36ae5032c22279b55dd07e614f25f29a99200d5b44b0158f
MD5 1bec49f7ea28c3a0801541b3841f29b0
BLAKE2b-256 875cf33374adcad7f96de723e66fdc68ffba0027e7ad92ca0d0d7dc8959cbf78

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.3.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 6a885d1cfed215b4eba2e3dfcac2d2214383e91bf68f76e93ce27c3594d709d6
MD5 66a786f37d5e1617050cf719bcd2ebb0
BLAKE2b-256 0c36de3a5ec311ddd82380a043cfbeb81ac35ee5209deccbb84ba5fde2811f87

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.3.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb9d3712f032b5c66d3aa186ec6d8a84af7a8e9757a6766e28ed88fbb705564b
MD5 c5039c92571b9502a8a9e1e5461c797e
BLAKE2b-256 253017e5f1f68124c5d6b96437ccfbbc05f003f8c85ee0ae21a14d72af11020c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.3.5-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.0 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.3.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91956ea2c00b7fb258442155edf443dffdaac15316eb8a314b8e242fd8c642cf
MD5 851414c850940beb2263b1788fbf7196
BLAKE2b-256 51db1e25d00dfca1149d0a6e858724f35f57b74580ecc79dffc2cc755e5c266a

See more details on using hashes here.

Provenance

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