.pre-commit-config.yaml•1.21 kB
---
# Install Git hooks so commits run hooks automatically:
# pre-commit install
#
# Manually run hooks on STAGED* files:
# pre-commit run
#
# Manually run hooks on CHANGED* files:
# git diff --name-only -z | xargs -0 pre-commit run --files
#
# Manually run hooks on ALL files:
# pre-commit run --all-files
#
# *Some hooks run repo-wide either way.
#
# To enable ruff fixing on manual run or pre-commit, see .mega-linter.local.yml
#
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: "^docs/apis/"
- id: end-of-file-fixer
exclude: "^docs/apis/"
- id: check-toml
- repo: local
hooks:
- id: mega-linter
name: run MegaLinter (Docker)
entry: bash
language: system
args:
- -lc
- |
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/tmp/lint" \
-w /tmp/lint \
-e HOME=/tmp \
-e RUN_LOCAL=true \
-e MEGALINTER_CONFIG=.mega-linter.local.yml \
ghcr.io/oxsecurity/megalinter-python:v9.1.0
pass_filenames: false