forked from saleor/saleor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
71 lines (63 loc) · 1.94 KB
/
.pre-commit-config.yaml
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
61
62
63
64
65
66
67
68
69
70
71
default_language_version:
python: python3.12
exclude: ^(.semgrep|vendored)/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^templates/templated_email/compiled/
exclude_types: [svg,graphql]
- id: end-of-file-fixer
exclude: ^templates/templated_email/compiled/
exclude_types: [svg]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
language: system
exclude: (tests|vendored)/
- repo: https://github.com/fpgmaas/deptry.git
rev: "0.21.1"
hooks:
- id: deptry
- repo: https://github.com/returntocorp/semgrep
rev: v1.89.0
hooks:
- id: semgrep
exclude_types:
- yaml
args:
- scan
- --config
- .semgrep/
# Do not try to scan '.semgrep/' directories as they contain test files
# thus they will trigger findings.
- --exclude=.semgrep/
# Set the exit code to non-zero if there are findings.
- --error
# Do not check for version updates, it slows down the execution.
- --disable-version-check
# Quiet mode in order to not pollute the pre-commit outputs.
# Replace --quiet with --verbose to debug issues.
- --quiet
- repo: local
hooks:
- id: migrations-check
language: system
name: Check for uncreated migrations.
entry: sh -c "./manage.py makemigrations --check --dry-run"
files: "models\\.py$"
stages: [pre-commit]
- repo: local
hooks:
- id: gql-schema-check
language: system
name: Check GraphQL schema is up to date.
entry: sh -c "./manage.py get_graphql_schema | diff saleor/graphql/schema.graphql -"
stages: [pre-commit]