gindex / recipemd-validator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

recipemd-validator

Out-of-the-box RecipeMD validation hook for pre-commit.

Usage

Add this to your .pre-commit-config.yaml:

  - repo: git://github.com/gindex/recipemd-validator
    rev: v0.0.1
    hooks:
      - id: validate-recipemd

Without pre-commit

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

About

License:GNU Lesser General Public License v3.0


Languages

Language:Python 100.0%