8000 GitHub - flaudisio/pre-commit-hooks: Miscellaneous hooks for pre-commit.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

flaudisio/pre-commit-hooks

Repository files navigation

pre-commit hooks

Miscellaneous hooks for pre-commit.

Hooks available

  • check-zero-width-spaces - Forbid files which have one or more zero width spaces (U+200B).

  • hadolint - Run Hadolint on Dockerfiles.

  • nomad-fmt - Run nomad fmt on Nomad manifests.

  • packer-validate - Run packer validate on JSON files.

How to install

  1. Install dependencies:

  2. Install the pre-commit hook globally:

    $ pre-commit init-templatedir -t pre-commit ~/.git-template
  3. Create the .pre-commit-config.yaml file:

    $ cd /path/to/my/repo/
    $ vim .pre-commit-config.yaml

    Tip: use the example from the next section as a start point.

  4. Run:

    $ pre-commit run -a

Full example

# .pre-commit-config.yaml

repos:
  - repo: https://github.com/flaudisio/pre-commit-hooks
    rev: v0.11.0
    hooks:
      - id: check-zero-width-spaces
      - id: hadolint
        args:
          - --config .hadolint.strict.yaml
          - --ignore DL3013
          - --ignore DL3018
          - --trusted-registry registry.example.com:5000
        exclude: ^cookiecutter/.+/Dockerfile$
      - id: packer-validate
        files: ^templates/.+\.json$

License

MIT.

About

Miscellaneous hooks for pre-commit.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0