Useful pre-commit hooks based on NodeJS scripts.
Does not require to have NodeJS installed:
pre-commit will fetch & install it under the hood.
Dockerfile in this repo was taken from here.
Table of contents
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs sha: v1.1.0 hooks: - id: dockerfile_lint - id: markdown-toc - id: htmlhint # optional custom config: args: [--config, .htmlhintrc] - id: htmllint
Regex-based linter: https://github.com/yaniswang/HTMLHint
Requires you to have a config file like this default
By default, a table of content will be inserted in your repo root
injecting the TOC on lines with: "<!-- toc -->"
When the TOC is added or updated, the hook will fail with
Files were modified by this hook.
You then just have to
git add your
README.md and commit again (or
git commit -a).