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

ryl check is the lint subcommand (a ryl format formatter is coming) and the recommended form. Bare ryl <paths> still lints identically today but is being phased out (a future release will deprecate it, then a later one will remove it), so prefer ryl check.

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

# Using npx (Node.js)
npx @owenlamont/ryl check -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.21.0.tar.gz (429.9 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.21.0-py3-none-win_arm64.whl (3.0 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ s390x

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

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

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

Uploaded Python 3manylinux: glibc 2.17+ i686

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ryl-0.21.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.21.0.tar.gz.

File metadata

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

File hashes

Hashes for ryl-0.21.0.tar.gz
Algorithm Hash digest
SHA256 9d68515af70248c57410dba327740c2fb3937fe57e343c7e53489834f839d3a8
MD5 b05ac5f4fab47527fab943e5b3cacdc4
BLAKE2b-256 c0594f9fac0ac5663c48a4b29c3daec47d5bd7c9d8d9e167dfe157c939ed1908

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.21.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.21.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 2012256f92d1f9ce1fba248b3122ca0bc541bd6f93229ecb18f53b780e4be70f
MD5 01a55d5f5cf93b9720f7fd7f76271950
BLAKE2b-256 8228d711a19887e894c15047bb1e938b4c51aade72d13788df8534ed72a3df43

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.21.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.21.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 74a776ef1371998f1f91db8f5afc0a70a0711227c3bb1db154823f161f14e582
MD5 40bc095aabfb92053d36adb0164fb31a
BLAKE2b-256 2e702723dbb47a4b6639ddaf12bb1409979060fa779431bd1ceeb39889890faf

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.21.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.21.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3bb4e41b702f1189c0d3ba1ff737a4ce57832c2735bce78b949af0a12452f668
MD5 97f699073a04554c2199be383e50b3b9
BLAKE2b-256 20e73cb6cf562f1b8599620a7b65997e595702ce669886bdc73f0cd1b4c47d9d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 19442d46679036a962a94a8b8110e8ca9a979bf74a2b2faceeada34879653fad
MD5 08278a0d4a5a79caa2fde477ad41f623
BLAKE2b-256 df2d6c3703b9a2d83359df73d19a8b71168c1f0daecd98fb1132a5d046c60452

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b32affbf9163cbeaa77a0dd231b7f26abc62d36acffe52650c71c0fee1580b6e
MD5 1ba880251dab78b51dd18dc5245a7ec9
BLAKE2b-256 d3aaf5368e0508e40b782f54c63803d70e71bd2aecadb6e8acf9405a282a1891

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 e9d50eb9f0f4ceadd778e5b15daeaea3097cbeb7364123545933804812ef3851
MD5 426cc1f16aeff1f2cad3d7f049ef7538
BLAKE2b-256 e732b50326f16eb05728ea7b0ac20876761b58a70b4fc956a21e7ed1df33daff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 12f3f3e6f32ed82889dce88bb5b1f0b01f9e69a83b7963cb3d4a7040bf370a60
MD5 c23c2278b51f075a10dc4ec27f760677
BLAKE2b-256 2c933c18bd67752763840efab484c3b11b76672abbd4f75b3184e33e5dc3b26d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 37b8fb8fc44265358897f915ce4e2a98eb435238789af6f46e79be4b6bd15a6e
MD5 1afb17cd4c6e081360012ae389d401f6
BLAKE2b-256 f94a5bb521990e698e6df5d95164268f986cdf8734f20f927e8e12beea916114

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7e7512379e55aeb763d73b30f457a8146917017f8d700351734239ba22a0f3b5
MD5 75cdfb93031d73feba3ffc9d55ac5b8a
BLAKE2b-256 a10468c5cf08e1b0cee4cb95b2eee3ec0e9a434dce1e89ac0c434c494e350bdb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ryl-0.21.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2abaa89eeefab199f1905e7ce58fb4ec53fc321b845fe002f1a03c73dfab1b13
MD5 be3f6a4b1e52ade01c625783bee382df
BLAKE2b-256 a059e660ef1e791222a6ad9e5e02d533c9f01c8ffcda90a34f23ca3724cb6f62

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ryl-0.21.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.21.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae2e4ed74a5986bd0dda73f292fe42ebe9d4492709c534e3298f3615e8cd6394
MD5 92ec57b8b2f414276a863462ac67047d
BLAKE2b-256 28947870e38419697ddb9a6656e3ec08ce3046720ed23f2c69b46b1b46d4064c

See more details on using hashes here.

Provenance

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