Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Build Status Known Vulnerabilities

Useful pre-commit hooks based on NodeJS scripts.

Does not require to have NodeJS installed: pre-commit will fetch & install it under the hood.

The test Dockerfile in this repo was taken from here.

Table of contents

Usage

repos:
-   repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
    rev: v1.1.1
    hooks:
    -   id: htmlhint
        # optional custom config:
        args: [--config, .htmlhintrc]
    -   id: htmllint
    -   id: markdown-toc
        # optional custom config:
        args: [--indent, "    ", -i]
    -   id: dockerfile_lint
        # optional custom config:
        args: [--json, --verbose, --dockerfile]

htmlhint

Regex-based linter: https://github.com/yaniswang/HTMLHint

htmllint

Uses htmlparser2-based linter: htmllint.

Requires you to have a config file like this default .htmllintrc.

markdown-toc

By default, a table of content will be inserted in your repo root README.md, 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).

dockerfile_lint

Simply call the latest version of dockerfile_lint

You can’t perform that action at this time.