-
Notifications
You must be signed in to change notification settings - Fork 847
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (60 loc) · 2.11 KB
/
.pre-commit-config.yaml
File metadata and controls
60 lines (60 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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