Skip to content

Pre-commit

.pre-commit.yml

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.6.0
    hooks:
      - id: check-added-large-files
        args: ['--maxkb=256']
      - id: check-executables-have-shebangs
      - id: check-symlinks
      - id: check-toml
      - id: check-yaml
        args: ['--allow-multiple-documents']
      - id: destroyed-symlinks
      - id: end-of-file-fixer
      - id: mixed-line-ending
      - id: no-commit-to-branch
      - id: trailing-whitespace

System tool

Run a system-level executable with the system language.

entry specifies the binary path.

- repo: local
  hooks:
    - id: ansible-lint
      name: ansible-lint
      entry: ansible-lint
      language: system
      types: [yaml]
      files: \.(yaml|yml)$
      pass_filenames: false