-
Notifications
You must be signed in to change notification settings - Fork 905
/
.pre-commit-config.yaml
111 lines (103 loc) · 3.67 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit, manual]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.277
hooks:
- id: ruff
name: "ruff on kedro/, tests/ and docs/"
args: ["--fix", "--exit-non-zero-on-fix"]
exclude: "^kedro/templates/|^features/steps/test_starter/"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml # Checks yaml files for parseable syntax.
exclude: "^kedro/templates/|^features/steps/test_starter/"
- id: check-json # Checks json files for parseable syntax.
- id: check-added-large-files
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: debug-statements # Check for debugger imports and py37+ `breakpoint()` calls in python source.
exclude: "^kedro/templates/|^features/steps/test_starter/"
- id: requirements-txt-fixer # Sorts entries in requirements.txt
exclude: "^kedro/templates/|^features/steps/test_starter/"
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
hooks:
- id: mypy
args: [--allow-redefinition, --ignore-missing-imports]
exclude: |
(?x)(
^kedro/templates/|
^docs/|
^features/steps/test_starter/
)
additional_dependencies:
- types-cachetools
- types-filelock
- types-PyYAML
- types-redis
- types-requests
- types-setuptools
- types-toml
- attrs
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black~=22.0]
entry: blacken-docs --skip-errors
- repo: local
hooks:
- id: black
name: "Black"
language: system
files: ^kedro/|^features/|^tests/
types: [file, python]
exclude: ^features/steps/test_starter|^kedro/templates/
entry: black
- id: imports
name: "Import Linter"
language: system
pass_filenames: false
entry: lint-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
hooks:
- id: mypy
args: [--allow-redefinition, --ignore-missing-imports]
exclude: |
(?x)(
^kedro/templates/|
^docs/|
^features/steps/test_starter/
)
additional_dependencies:
- types-cachetools
- types-filelock
- types-PyYAML
- types-redis
- types-requests
- types-setuptools
- types-toml
- attrs
- repo: local
hooks:
# Slow lintint
- id: secret_scan
name: "Secret scan"
language: system
exclude: ^features/steps/test_starter
pass_filenames: false
entry: make secret-scan
- id: bandit
name: "Bandit security check"
language: system
types: [file, python]
exclude: ^kedro/templates/|^tests/|^features/steps/test_starter
entry: bandit -ll
# Manual only