p15r / pre-commit-hooks

Heavily opinionated pre-commit hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pre-commit-hooks

example workflow

Heavily opinionated pre-commit hooks I deem useful.

Hooks

Hook ID Description
markdown-detect-nonref-links Detects non-ref links in Markdown
rego-unsafe-boolean-comparison Detects unsafe boolean comparison in Rego. For fix, see harness/
dockerfile-multiline-cmds Detects suboptimal use of multiline commands in Dockerfiles

Using pre-commit-hooks

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

- repo: https://github.com/p15r/pre-commit-hooks.git
  rev: v0.3.0
  hooks:
  - id: markdown-detect-nonref-links
  - id: rego-unsafe-boolean-comparison
  - id: dockerfile-multiline-cmds

(run pre-commit autoupdate for latest hooks)

Development

  • Use the try-repo command for fast feedback loop:
cd dummyrepo/
pre-commit try-repo ../pre-commit-hooks/ --verbose

About

Heavily opinionated pre-commit hooks

License:MIT License


Languages

Language:Python 67.7%Language:Open Policy Agent 24.8%Language:Shell 7.5%