-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
92 lines (86 loc) · 3.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
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
# 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/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: trailing-whitespace
stages: [commit, manual]
- id: end-of-file-fixer
stages: [commit, manual]
- id: check-yaml # Checks yaml files for parseable syntax.
- 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.
- id: detect-private-key # Detects the presence of private keys
- id: requirements-txt-fixer # Sorts entries in requirements.txt
- id: flake8
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.720
hooks:
- id: mypy
args: [--allow-redefinition, --ignore-missing-imports]
exclude: |
(?x)(
^docs/
)
- repo: local
hooks:
# It's impossible to specify per-directory configuration, so we just run it many times.
# https://github.com/PyCQA/pylint/issues/618
# The first set of pylint checks if for local pre-commit, it only runs on the files changed.
- id: pylint-quick-kedro_server
name: "Quick PyLint on kedro_server/*"
language: system
types: [file, python]
files: ^kedro_server/
entry: pylint -j0 --disable=unnecessary-pass
stages: [commit]
- id: pylint-quick-tests
name: "Quick PyLint on tests/*"
language: system
types: [file, python]
files: ^tests/
entry: pylint -j0 --disable=missing-docstring,redefined-outer-name,no-self-use,unused-argument
stages: [commit]
# The same pylint checks, but running on all files. It's for manual run with `make lint`
- id: pylint-kedro_server
name: "PyLint on kedro_server/*"
language: system
pass_filenames: false
stages: [manual]
entry: pylint -j0 --disable=unnecessary-pass kedro_server
- id: pylint-tests
name: "PyLint on tests/*"
language: system
pass_filenames: false
stages: [manual]
entry: pylint -j0 --disable=missing-docstring,redefined-outer-name,no-self-use,invalid-name,protected-access,unused-argument tests
- id: black
name: "Black"
language: system
pass_filenames: false
entry: black kedro_server tests
- id: secret_scan
name: "Secret scan"
language: system
pass_filenames: false
entry: make secret-scan
- id: bandit
name: "Bandit security check"
language: system
types: [file, python]
exclude: ^tests/
entry: bandit -ll
- id: legal
name: "Licence check"
language: system
pass_filenames: false
entry: make legal