# Pre-commit Configuration for game_recording # Install: pre-commit install && pre-commit install --hook-type pre-push # Run: pre-commit run --all-files # Update: pre-commit autoupdate # NOTE: this subproject lives inside the ~/src/utils monorepo, whose git root is # one level up. pre-commit always runs hooks from the git root, so every path # below is written relative to THAT, not to this directory, and the top-level # `files` key keeps these hooks off the sibling subprojects. CI invokes this # config exactly the same way: # pre-commit run --config game_recording/.pre-commit-config.yaml --all-files files: ^game_recording/ default_language_version: python: python3 default_stages: [pre-commit] fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] - id: end-of-file-fixer - id: check-yaml - id: check-json - id: check-toml - id: check-added-large-files args: [--maxkb=2000] - id: check-merge-conflict - id: detect-private-key - id: debug-statements - id: check-ast - id: mixed-line-ending args: [--fix=lf] - id: requirements-txt-fixer - repo: local hooks: - id: subproject-scope name: subproject scope regex still matches entry: scripts/check_subproject_scope.sh game_recording language: script # always_run so the top-level `files` filter cannot skip the one hook # whose job is to notice that filter has stopped matching anything. always_run: true pass_filenames: false - id: no-noqa name: Block noqa comments entry: '(?i)#\s*(noqa|type:\s*ignore)' language: pygrep types: [python] - id: no-ruff-noqa name: Block ruff noqa file-level comments entry: '(?i)#\s*ruff:\s*noqa' language: pygrep types: [python] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.17.2 hooks: - id: ruff-format types_or: [python, pyi] - repo: local hooks: - id: pytest name: pytest entry: scripts/run_subproject_tests.sh game_recording language: script types: [python] pass_filenames: false require_serial: true stages: [pre-push]