A pre-commit hook for ryl, the fast YAML linter written in Rust.
Distributed as a standalone repository so that ryl releases published to
PyPI can be consumed directly by pre-commit.
Add the hook to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/owenlamont/ryl-pre-commit
# Match the latest ryl release tag.
rev: v0.21.0
hooks:
- id: rylPass additional CLI options through the args key, for example to point at a
custom configuration file:
- repo: https://github.com/owenlamont/ryl-pre-commit
rev: v0.21.0
hooks:
- id: ryl
args: [--config-file, configs/yl.yml]The ryl hook above only sees YAML files. To also lint YAML embedded in
Markdown — front matter and fenced yaml/yml blocks — add the ryl-markdown
hook, which runs ryl check --markdown and so needs no extra [files] config:
- repo: https://github.com/owenlamont/ryl-pre-commit
rev: v0.21.0
hooks:
- id: ryl
- id: ryl-markdownIt targets .md, .markdown, .mdx, .qmd, and .Rmd files. To autofix the
embedded YAML in place, add args: [--fix]:
- id: ryl-markdown
args: [--fix]Requires ryl >= 0.11.0.
MIT (see LICENSE)