ci: add pre-commit hooks for linting, security scanning, and secret detection

This commit is contained in:
qwen.ai[bot] 2026-08-12 13:40:43 +00:00
parent e4778f6298
commit df4336a912

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

@ -0,0 +1,40 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ['--unsafe']
- id: check-json
- id: check-added-large-files
args: ['--maxkb=1024']
- id: detect-private-key
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
args: ['-r', '-ll', '-ii']
additional_dependencies: ["bandit[toml]"]
- repo: local
hooks:
- id: pytest-check
name: Run pytest smoke tests
entry: uv run pytest -q --tb=short
language: system
pass_filenames: false
always_run: true
stages: [pre-push]