forked from scalyr/scalyr-agent-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
62 lines (61 loc) · 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
default_language_version:
python: python3.10
exclude: '(third_party.*|third_party_tls.*)'
repos:
- repo: local
hooks:
- id: black
name: black
# NOTE: We don't use --check flag because we want pre-commit hook to auto format the files
# and not just performed the check like we do on the CI
entry: .tox/lint/bin/black --config pyproject.toml
language: script
types: [file, python]
- repo: local
hooks:
- id: flake8
name: flake8
entry: .tox/lint/bin/flake8 --config lint-configs/python/.flake8
language: script
types: [file, python]
- repo: local
hooks:
- id: pylint
name: pylint
entry: .tox/lint/bin/pylint -E --rcfile=./lint-configs/python/.pylintrc
language: script
types: [file, python]
- repo: local
hooks:
- id: bandit
name: bandit
entry: .tox/lint/bin/bandit --configfile lint-configs/python/bandit.yaml -lll
language: script
types: [file, python]
- repo: local
hooks:
- id: mypy
name: mypy
# NOTE: We intentionally want to run in incremental mode to speed this check up
# (which is not the case for tox -elint target and CI where we want to avoid using
# MyPy cache)
entry: .tox/lint/bin/mypy --pretty --config-file ./lint-configs/python/mypy.ini
language: script
types: [file, python]
- repo: local
hooks:
- id: shellcheck
name: shellcheck
# NOTE: We intentionally want to run in incremental mode to speed this check up
# (which is not the case for tox -elint target and CI where we want to avoid using
# MyPy cache)
entry: ./scripts/shell-scripts-lint.sh
language: script
types: [file, shell]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: check-yaml
# NOTE: We exclude some Kubernetes yaml files
exclude: (^k8s/|^k8s.pre-2.1/|^performance/kops_cluster_setup)