default_language_version: python: python3.11 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.12.3 hooks: - id: ruff files: "^kitsune/" exclude: "^.*/migrations/.*$|kitsune/sumo/db_strings.py" language_version: python3.11 - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 hooks: - id: prettier additional_dependencies: - prettier@3.2.0 - prettier-plugin-svelte@3.1.2 files: "^svelte/" - repo: local hooks: - id: check-group-visibility-leak name: Check for group visibility leaks entry: > bash -c 'if grep -rn "\.groups\.all()" --include="*.py" --include="*.html" kitsune/ --exclude-dir=migrations | grep -v "# noqa: group-leak"; then echo "ERROR - Found .groups.all() which bypasses GroupProfile visibility"; echo "Use profile.visible_group_profiles(viewer) or GroupProfile.objects.visible(viewer) instead"; echo "See docs/conventions.md Security Patterns section"; exit 1; fi' language: system pass_filenames: false - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.15.0 hooks: - id: mypy additional_dependencies: - boto3-stubs==1.38.8 - types-redis==4.6.0.20240106 - types-requests==2.32.0.20250328 - types-python-dateutil==2.9.0.20241206 - types-simplejson==3.20.0.20250326 - types-PyYAML==6.0.12.20250402 files: "^kitsune/" exclude: "/migrations/" - repo: https://github.com/pre-commit/mirrors-eslint rev: v9.31.0 hooks: - id: eslint files: "^(svelte/|webpack/).*\\.(js|ts|jsx|tsx)$" exclude: "webpack/.*|webpack\\..*\\.js" additional_dependencies: - eslint@9.31.0 - eslint-plugin-import@2.29.1 - eslint-import-resolver-webpack@0.13.10