forked from saleor/saleor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
71 lines (65 loc) · 2.01 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
exclude: ^.semgrep/
repos:
- 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.1.8
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
language: system
exclude: tests/
- repo: https://github.com/fpgmaas/deptry.git
rev: "0.12.0"
hooks:
- id: deptry
- repo: https://github.com/returntocorp/semgrep
rev: v1.52.0
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]