forked from saleor/saleor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
80 lines (73 loc) · 2.2 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
72
73
74
75
76
77
78
79
80
exclude: ^.semgrep/
repos:
<<<<<<< HEAD
- repo: https://github.com/ambv/black
rev: 22.6.0
hooks:
- id: black
language_version: python3.9
=======
>>>>>>> fa9ea3af1251eaa792bebc0aabcf03f49b31a7e9
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.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.3.4
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
language: system
exclude: tests/
- repo: https://github.com/fpgmaas/deptry.git
rev: "0.15.0"
hooks:
- id: deptry
- repo: https://github.com/returntocorp/semgrep
rev: v1.66.2
hooks:
- id: semgrep
language_version: python3.9
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
# Do not append directory names to the rules, otherwise
# it may misbehave.
- --no-rewrite-rule-ids
# 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: [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: [commit]