Skip to content

Instantly share code, notes, and snippets.

@leehanchung
Created July 18, 2024 16:43
Show Gist options
  • Save leehanchung/f6d3d4606a8f1bb35704d42a0de67ab7 to your computer and use it in GitHub Desktop.
Save leehanchung/f6d3d4606a8f1bb35704d42a0de67ab7 to your computer and use it in GitHub Desktop.
sample python pre-commit configuration
fail_fast: true
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args:
- --unsafe
- id: check-added-large-files
args: ['--maxkb=50000']
- id: check-xml
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: debug-statements
- id: fix-byte-order-marker
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.14
hooks:
- id: validate-pyproject
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment