pre-commit and prek¶
ryl's hooks are published at
ryl-pre-commit and run with both
pre-commit and prek. Each hook
installs ryl from PyPI at the version matching rev.
Hooks¶
| Hook id | Runs | Files |
|---|---|---|
ryl-check |
ryl check |
YAML |
ryl-format |
ryl format |
YAML |
ryl-check-markdown |
ryl check --markdown |
.md, .markdown, .mdx, .qmd, .Rmd |
ryl-format-markdown |
ryl format --markdown |
.md, .markdown, .mdx, .qmd, .Rmd |
ryl and ryl-markdown are legacy aliases for ryl-check and ryl-check-markdown.
The format hooks need rev: v0.25.0 or later. The Markdown hooks lint and format
YAML in Markdown with no [files] config.
Configuration¶
To apply safe fixes, pass --fix to ryl-check and list it before ryl-format: a
fix can leave layout the formatter then changes. Other CLI options also go in args.
prek also reads .pre-commit-config.yaml, so either file works with prek.
Seeing warnings after an upgrade¶
pre-commit and prek hide the output of a hook that passes, including ryl's config deprecation warnings. After upgrading ryl, run the hook verbosely to see them:
A hook runs ryl once per batch of files, and each run warns once, so the same warning can appear several times.