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 behaviour are still maturing.

Full documentation lives at https://ryl-docs.pages.dev/.

Compatibility note

  • ryl aims to match yamllint behaviour and includes many parity tests.
  • ryl uses the granit-parser parser stack, while yamllint uses the PyYAML parser stack.
  • granit-parser and PyYAML do not always agree on which files are valid YAML.
  • ryl targets YAML 1.2 strictly. yamllint defaults to YAML 1.1 semantics, so bareword booleans like yes / no / on / off (and case variants) are plain strings in ryl and booleans in yamllint. Leading-zero integers like 0755 are decimal in ryl and octal in yamllint. The same 1.2 semantics also apply when ryl parses .yamllint configuration files inherited from yamllint. See the YAML version compatibility page for the practical implications.

Quick start

ryl enables no rules by default, so it needs a configuration that turns rules on. -d 'extends: default' opts into yamllint's standard rule set for a one-off run; for a project, drop a .ryl.toml at the root (see Configuration).

# Using uv (Python)
uvx ryl -d 'extends: default' .

# Using npx (Node.js)
npx @owenlamont/ryl -d 'extends: default' .

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

Installation

uv tool install ryl                 # uv
npm install -g @owenlamont/ryl      # npm
pip install ryl                     # pip
cargo install ryl                   # cargo
pixi global install ryl             # conda-forge

Status and scope

  • All 23 yamllint rules are implemented, plus a ryl-only tags rule (forbids unsafe and non-portable YAML tags; configured in TOML only). The current rule reference and per-rule pages are at https://ryl-docs.pages.dev/rules/.
  • Auto-fixing (--fix) is supported for braces, brackets, commas, comments, comments-indentation, new-line-at-end-of-file, new-lines, and quoted-strings. The set of rules that may apply fixes is configurable via the TOML [fix] table.
  • --diff previews those safe fixes as a unified diff on stdout instead of writing them (modelled on ruff check --diff); it is mutually exclusive with --fix, works with stdin, and exits 1 iff some file would change.
  • TOML is the recommended configuration format and supports ryl-only features that have no upstream equivalent: the [fix] table, [per-file-ignores], and rule options such as allow-double-quotes-for-escaping.
  • TOML assigns each file a source kind via the [files] table (yaml = [...], markdown = [...]). The legacy yaml-files key is YAML-only; in TOML use [files].yaml.
  • YAML embedded in Markdown (front matter and fenced yaml/yml blocks) can be linted by listing globs under [files].markdown; diagnostics map back to the Markdown file. It is off by default; --fix writes safe fixes back into the embedded blocks and --diff previews them at the host-file level. See https://ryl-docs.pages.dev/markdown/.
  • yamllint-style YAML configuration is also accepted (.yamllint, .yamllint.yml, .yamllint.yaml) for drop-in compatibility, including the built-in default, relaxed, and empty presets via extends. An existing yamllint configuration can be converted with ryl --migrate-configs --migrate-write.
  • --list-files prints the files ryl would lint (after ignores and config discovery) and exits, without running rules. --no-warnings suppresses warning-level diagnostics in the output. --strict turns a warning-only run into exit code 2.
  • Pass - as the input to read YAML from stdin (ruff convention). Add --stdin-filename <PATH> so diagnostics, project-config discovery, and path-based filtering (yaml-files, per-file-ignores, per-rule ignore) use that filename. Without it, diagnostics are labelled <stdin>, config is anchored at the current working directory, and all path-based filtering is skipped so every enabled rule runs. - cannot be combined with other inputs; --fix cannot read from stdin, but --diff can.
  • ryl server runs ryl as a Language Server (LSP) over stdio, giving editors inline diagnostics, a source.fixAll.ryl code action, and formatting (= apply safe fixes). It complements Red Hat's yaml-language-server rather than replacing it, and is built in by default (a minimal binary without it builds with cargo install ryl --no-default-features). See https://ryl-docs.pages.dev/editor-integration/.
  • Run ryl --help for the authoritative CLI reference.

For installation walkthroughs, configuration presets, and per-rule documentation, see the docs site.

Performance

ryl is significantly faster than yamllint on large trees. The figure below is from a 5x5 file-count × file-size matrix with 5 runs per point:

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

The benchmark script is in scripts/benchmark_perf_vs_yamllint.py; run it with --help for the full option set.

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's vendored YAML DOM is derived from 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 starting ryl.
  • granit-parser - a saphyr-parser fork with comment and style metadata that ryl uses for event-stream parsing.
  • 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.19.0.tar.gz (438.6 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.19.0-py3-none-win_arm64.whl (3.0 MB view details)

Uploaded Python 3Windows ARM64

ryl-0.19.0-py3-none-win_amd64.whl (3.2 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

ryl-0.19.0-py3-none-musllinux_1_2_aarch64.whl (3.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

ryl-0.19.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ryl-0.19.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

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

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

ryl-0.19.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (4.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

ryl-0.19.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

ryl-0.19.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ryl-0.19.0-py3-none-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for ryl-0.19.0.tar.gz
Algorithm Hash digest
SHA256 6fb9e74022fe253dd9daa07f3596caa1eb9e98f19544d31a01aa140878571cc5
MD5 ec92f15d154a6ed570d31cf056a35403
BLAKE2b-256 11c78de386e555234a014f100866a1b8160c98a99a2e8f8df3e7189b85cc0ff6

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for ryl-0.19.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 ec1755fc30d016a71dd8a64c4b018c561d005dd5937a52de2338c46631aa594f
MD5 9edc8e755c57cc427bf682dd72526d83
BLAKE2b-256 f2638d01ee48bad029b0efab7922e93ac45ff030f7f5755c2d7b9abf4eef1075

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for ryl-0.19.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3070bb5d229ccbea90b07285fe06387868635032485b6b2b56d5e41cd17f38f9
MD5 92037f9e43b26a153192735826e9172b
BLAKE2b-256 184d9fcac2a395ccea0e437d8f7c600d0bf0df7784df0de30a7dfefaae2f0821

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.19.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.13

File hashes

Hashes for ryl-0.19.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6bffaa8586799e5ffea2774a556b8cc623e63da3ae4cb256a490cec8da04fdf5
MD5 b1df09caf602f8a9536cadcea6a07010
BLAKE2b-256 030e8d358d306ae82dc45804409a9c587ee63bc163f6516caa2044eea348a486

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 19d8cdaf27f09511ca003211be246f3137b4c5872586c8ebe0ed15be2579ceb7
MD5 f3f38098cc7bb15fa80ba813f754efd9
BLAKE2b-256 dae628650be246b7ccf654727d46fd136b0b5e96c462ca169d3e74f92a9cd633

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9a0704efc65bd3b130a8944a0ae45ee38171a9424605daed24a87739bc7da8d4
MD5 7c93497dedbc476ad4d85b72373e608f
BLAKE2b-256 e97810d58f7b242490b7fe599e332a1dcbaac465c8c0cee2099484a846226989

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f5e020a52cfbf1cdcc86cb609df1b282be7a393c9b564f53dc5e3d84b2a35f52
MD5 aa212529db8c60f13957fafc451a47a6
BLAKE2b-256 a04b77e0a5995868770f44a61936ddc2f39950facf8b771d6f60522693fea259

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 cf20986ced5ad61966a709dbe0ca9a118ed2f0fe5f45286b6cea46e25383cc4c
MD5 067d2a177b7e2c8add9ec9fdec292333
BLAKE2b-256 b9d939d6d9dc931edb3b0a377bab94a5fada510e445618d18d48c87691e5c8ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 94a3a5162fef0b8125bd2806cf970dc7fe015ca510a2d6b55522f71ce97d7b9d
MD5 d67536cc56503d0071bd973f67ff2003
BLAKE2b-256 c0fd4b90a4d6850aebcd5e5a26d8b85976d18ec419fed1a172893badfa23700c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c1c94063af16b5db01299962e78b392c319cbcb988eb2843cff3b99f95948483
MD5 78dc16c529283856c33401e1702046d6
BLAKE2b-256 f1dc197919ee53f1d2acdb9c3c0994f46ed9ce47a4b987db9e8c9ab2506e2306

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.19.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 45f0c6b1856d8518478a28e85a41924baf8f118ed2f58d8a80bb037a745a1582
MD5 1937bdf1bf070f8047c59b1beb2d77c4
BLAKE2b-256 5617501c28d7003aefd9f434ec62fa5e513953a8c98074576b2b3c58f5c81dfe

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for ryl-0.19.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d32ae08afdda84077c81abb1097912cc851ce2f5c6590a1d7787c2a9f3f8711b
MD5 87e4acbb0f4a0dd1ce7e329707358ad5
BLAKE2b-256 233e8aa9b306da3ca15e0c70fe9a62e8aac2dea5904f97a1e4c99f094b7187f2

See more details on using hashes here.

Provenance

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