From df4336a9121c508708b45e501628df2a4ead35c3 Mon Sep 17 00:00:00 2001 From: "qwen.ai[bot]" Date: Wed, 12 Aug 2026 13:40:43 +0000 Subject: [PATCH] ci: add pre-commit hooks for linting, security scanning, and secret detection --- .pre-commit-config.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..291f308 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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]