-
Notifications
You must be signed in to change notification settings - Fork 14
/
.pre-commit-config.yaml
123 lines (123 loc) · 3.78 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
default_stages: [commit, push]
default_language_version:
# force all unspecified python hooks to run python3
python: python3
minimum_pre_commit_version: "1.20.0"
exclude: '^pola/static|^db_kbpoz/'
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
- id: remove-tabs
exclude: ^pola/tests/commands/test_import_brands_fixture\.tsv$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
exclude: ^package-lock\.json$|^pola/gpc/fixtures/$
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args:
- --remove
- id: mixed-line-ending
- id: name-tests-test
args: ['--django']
- id: requirements-txt-fixer
files: ^dependencies/.+\.txt$
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: ['--py39-plus']
- repo: https://github.com/psf/black
rev: '24.4.0'
hooks:
- id: black
args: ["--line-length", "120", "--skip-string-normalization", "--target-version", "py38"]
language_version: python
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/adrienverge/yamllint
rev: 'v1.35.1'
hooks:
- id: yamllint
entry: yamllint -c yamllint-config.yml
- repo: https://github.com/ikamensh/flynt
rev: '1.0.1'
hooks:
- id: flynt
args:
# If flynt detects too long text it ignores it. So we set a very large limit to make it easy
# to split the text by hand. Too long lines are detected by flake8 (below),
# so the user is informed to take action.
- --line-length
- '99999'
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
name: Remove unnecessary noqa statements
additional_dependencies: ['flake8>=4.0.1']
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
- repo: https://github.com/PyCQA/flake8
rev: '7.0.0'
hooks:
- id: flake8
# - repo: https://github.com/hadolint/hadolint
# rev: 'v2.12.1-beta'
# hooks:
# - id: hadolint-docker
# entry: --entrypoint /bin/hadolint hadolint/hadolint:v2.12.0 --ignore DL3013 --ignore DL3018 --ignore DL3008 -
- repo: https://github.com/PyCQA/isort
rev: '5.13.2'
hooks:
- id: isort
- repo: local
hooks:
- id: shellcheck
name: Check Shell scripts syntax correctness
language: docker_image
entry: koalaman/shellcheck:v0.8.0 -x -a
files: \.sh$
- id: version-checks
name: Checks Django Version in docker-compose.yaml
language: system
entry: scripts/static_checks/django-version-check.py
pass_filenames: false
files: >
(?x)
^dependencies/production\.txt$|
^docker-compose.yaml$|