# Pre-commit hooks for flakestorm # Install: pip install pre-commit && pre-commit install # Run manually: pre-commit run --all-files default_language_version: python: python3.10 repos: # General file checks - 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 args: [--unsafe] # Allow custom tags in YAML - id: check-json - id: check-toml - id: check-added-large-files args: ['--maxkb=1000'] - id: check-merge-conflict - id: debug-statements - id: check-case-conflict # Black - Code formatter - repo: https://github.com/psf/black rev: 24.3.0 hooks: - id: black language_version: python3.10 args: [--config=pyproject.toml] # Ruff - Fast Python linter (replaces flake8, isort, etc.) - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.3.4 hooks: # Run the linter - id: ruff args: [--fix, --exit-non-zero-on-fix] # Run the formatter (alternative to black, but we use black) # - id: ruff-format # MyPy - Static type checker - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.9.0 hooks: - id: mypy additional_dependencies: - pydantic>=2.0.0 - types-PyYAML - types-aiofiles args: [--config-file=pyproject.toml] # Only check src directory to avoid checking untyped dependencies files: ^src/ # Security checks - repo: https://github.com/PyCQA/bandit rev: 1.7.8 hooks: - id: bandit args: [-c, pyproject.toml, -r, src/] additional_dependencies: ["bandit[toml]"] # CI configuration ci: autofix_commit_msg: | [pre-commit.ci] auto fixes from pre-commit hooks autofix_prs: true autoupdate_branch: '' autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' autoupdate_schedule: weekly skip: [] submodules: false