-
Notifications
You must be signed in to change notification settings - Fork 6
/
.pre-commit-config.yaml
127 lines (127 loc) · 4.52 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
124
125
126
127
# See https://pre-commit.com/hooks.html for more hooks
exclude: "^.venv$|^.cache$|^.pytest_cache$"
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ["--maxkb=499"] # ensures docker config compatability for all files
- id: check-merge-conflict
- id: check-yaml
exclude: ^(.*.go.yml)|(.*.template.y*ml)$|^charts/
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-executables-have-shebangs
- id: detect-private-key
exclude: "^certificates/(.*)$"
- id: detect-aws-credentials
exclude: "^certificates/(.*)$"
args: ["--allow-missing-credentials"]
# NOTE: Keep order as pyupgrade (will update code) then pycln (remove unused imports), then isort (sort them) and black (final formatting)
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup
language: python
entry: jupyter-notebook-cleanup
args:
- --remove-kernel-metadata
- --pin-patterns
- "[pin];[donotremove]"
files: .*[.]ipynb$
types: ["file"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
name: upgrade code
- repo: https://github.com/hadialqattan/pycln
rev: v2.2.2
hooks:
- id: pycln
args: [--all, --expand-stars]
name: prune imports
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
name: sort imports
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
name: black format code
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-no-eval
name: check for the `eval()` built-in python function
- repo: https://github.com/fortman/pre-commit-prometheus
rev: v1.2.0
hooks:
- id: check-rules
name: prometheus rule check
files: >
(?x)^(
services/monitoring/prometheus/.*\.rules\.yml
)$
#- repo: https://github.com/PyCQA/bandit
# rev: 1.7.4
# hooks:
# - id: bandit
# name: bandit python3 security linter
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
name: Shell scripts conform to shellcheck
- repo: local
hooks:
- id: run-pylint
name: Run pylint
description: Run pylint
entry: 'scripts/pre-commit-hooks/runPylint/launch.bash'
always_run: true
language: script
files: '^(.*\.py)$'
require_serial: true
- id: validate-template-dotenv
name: Validate template.env
description: Validate template.env
entry: 'scripts/pre-commit-hooks/validateTemplateDotEnv/launch.bash'
always_run: true
language: script
files: '^(.*)\/services\/(.*)(template\.env)$'
- id: validateDockerComposeNoDuplication
name: validateDockerComposeNoDuplication
description: validateDockerComposeNoDuplication
entry: 'scripts/pre-commit-hooks/validateDockerComposeNoDuplication/launch.bash'
always_run: true
language: script
files: '^(.*)(docker-compose.*\.y([a])?ml)$'
- id: validateMakeComposeSimcoreRuns
name: validateMakeComposeSimcoreRuns
description: validateMakeComposeSimcoreRuns
entry: 'scripts/pre-commit-hooks/validateMakeComposeSimcoreRuns/launch.bash'
always_run: true
language: script
files: '^(.*)\/services\/simcore/(docker-compose.*\.y([a])?ml)$'
- id: no-env-vars-exported-in-critical-pipeline-files
name: no-env-vars-exported-in-critical-pipeline-files
description: no-env-vars-exported-in-critical-pipeline-files
entry: 'scripts/pre-commit-hooks/no-env-vars-exported-in-critical-pipeline-files/launch.bash'
exclude: ^(services/maintenance-page/Makefile)$
always_run: true
language: script
files: '^(.*\/Makefile.*)|(.*\.deploy_everything_locally.bash)|(.*\/services/.*\/.*\.((sh)|(bash)))$'
- id: stack-yml-generated-is-valid
name: stack-yml-generated-is-valid
description: stack-yml-generated-is-valid
entry: 'scripts/pre-commit-hooks/stack-yml-generated-is-valid/launch.bash'
always_run: true
language: script
files: '^((.*)\/services\/simcore\/(.*))$'