Out-of-the-box RecipeMD validation hook for pre-commit.
Add this to your .pre-commit-config.yaml
:
- repo: git://github.com/gindex/recipemd-validator
rev: v0.0.1
hooks:
- id: validate-recipemd
If you want to use this package without pre-commit, install it using pip install "git+https://github.com/gindex/recipemd-validator.git"
and put the following in your .git/hooks/pre-commit
and make the hook executable chmod +x .git/hooks/pre-commit
:
#!/bin/sh
if [[ ! -z "$(git diff --cached --name-only --diff-filter=ACM | grep .md$)" ]]; then
set -e
git diff --cached --name-only --diff-filter=ACM | grep .md$ | xargs -n 1 recipemd-validator
fi