chore: add pre-commit hooks for linting, formatting, and security checks

This commit is contained in:
qwen.ai[bot] 2026-08-12 13:57:47 +00:00
parent 666c813cd4
commit 425aba531b

46
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,46 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: detect-private-key
- id: check-merge-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
language_version: python3.12
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
- types-all
args: [--ignore-missing-imports, --warn-no-return]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
hooks:
- id: bandit
args: [-r, -ll]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: ['--branch', 'main', '--branch', 'master']