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
winget install owenlamont.ryl       # winget (Windows)

Status and scope

  • All 23 yamllint rules are implemented, plus four ryl-only rules with no yamllint equivalent (tags, merge-keys, block-scalar-chomping, and unicode-line-breaks), 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, document-end, document-start, empty-lines, new-line-at-end-of-file, new-lines, quoted-strings, and trailing-spaces. 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.20.0.tar.gz (427.5 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.20.0-py3-none-win_arm64.whl (3.0 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

ryl-0.20.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.20.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

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

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

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

Uploaded Python 3manylinux: glibc 2.17+ i686

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ryl-0.20.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.20.0.tar.gz.

File metadata

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

File hashes

Hashes for ryl-0.20.0.tar.gz
Algorithm Hash digest
SHA256 873b31bab3de4b2a01b2a4c47e2df3909d2117c581a6c11b5ae02de64fa86061
MD5 7800e0252761755fb4da410f6c92534c
BLAKE2b-256 bf53271d3afbedbdce47c86d169ea5e775fe1ab38c387c27cf77e87f08f2895d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.20.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.20.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 5acc72802d5cce59d87c4761e1713fba27a756da7cb769282ce06e01cd8f0efa
MD5 1519b91c27e99c05413ed3e9a8dfd38f
BLAKE2b-256 848b30057f2d3292393a385f0689df5b7e3b964f6cec5694d8b6d9c50f67323d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.20.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.20.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d9e8363ee1cf9345920a6bcbbbd8b6bd765d9b43b4b5bc7b69faf67160331ffb
MD5 d8c17ce9f3e293a90f57cdf4653e7b49
BLAKE2b-256 3e2492f1c762f3dd4fe466a72142943f724ed3ce373d93f2a07415d8830283bc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.20.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.20.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 58524d90e03c3e51646153ef1ce6a4ab457ab4e50e8f2a525d2cdef8b4a37faf
MD5 9c8ef34929f6e6af8742eb81d588d0dd
BLAKE2b-256 e2e38608111d4e0359cb34ece54630603aa5f055c74ce3e4a7f816124db43d76

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 24c8c8b43c02ac9e95d9e7916289b19a0cd528b3cb2c4a9e2aef9d86ea59f655
MD5 0d91c7f74e7aa41b96e2b6d663a66495
BLAKE2b-256 5bd2d827f8214621d162c0dbc80e7cbe36f1fc791f426d343f34128a8c0f9c6a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a9d90e7bbc1f6b9eeb626ef3cfc11edb71c0434f050041917e6ce4f732d0030
MD5 55068271e102a11e1d3ea8d3bde78ceb
BLAKE2b-256 15f744ad1ae877b00f107fca1583b27e26c304537bd45ace9dae8dfbf9ed12f1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 bfc65bb639c7678cd62ca6106530d2c88c173654d37f9cee09ade31b8873bbdc
MD5 47b12e3f1f3530b5be36c7ca285339e0
BLAKE2b-256 106509d9d85bd12b830c9b4ed8d71473be0269e344c3bd633e5c7696318fe4e8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 305d6003040a83d39fc04fa85cb165bbf8c06502eb2a0a30551745a0ac4931f5
MD5 37553fa93b7ce946a801edcaab2a2f93
BLAKE2b-256 5e9593c6a4cd5e60be566ac3a9a1695018546541882c70a221d776547e78b5a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3cda102b210cda41674d15971cd501c987960d0fc3d626500a7e051446ccd0c8
MD5 03f8c46d980f18b8c5482d4e148db369
BLAKE2b-256 5ca55c95b87bcbbf8c4ee858deb084af51279ec11801ee65195943b0671d3b36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 dbb4f27c66762bc703c834c2be68c829f22c937f488fd76f1bc37c3b99afac89
MD5 70d2cb464a9c3482e75bb5861ae7844c
BLAKE2b-256 41122fd6855c907cf9134bda4d21eed6444d81aaf8e5b656914577ec14f8733a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.20.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c84667b3477644114521dc4b035cd9cac35ceea70b13a9cc580114175c588fb5
MD5 27c5d8cb59eb2d4ebedcb211d30434ec
BLAKE2b-256 07a2912a687c1af9f8858cf415b60af33245fe23b9d104ef496ee03ac4437afa

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.20.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.20.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ffab716814dccda60cf835e318f5899d8398fdebcebfdff5298162c41a2ba9b6
MD5 52839e9dbbffeac0740b064d529e68c0
BLAKE2b-256 be3712fde3cacf1f359daf80b9ce21360ebfee28c79bf5e7062d00ca1f37c874

See more details on using hashes here.

Provenance

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