forked from mckinsey/causalnex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
78 lines (73 loc) · 3.04 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
# 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.
# exclude:
- 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:
- id: detect-private-key # Detects the presence of private keys
- id: requirements-txt-fixer # Sorts entries in requirements.txt
- id: flake8
exclude: ^causalnex/ebaybbn
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
exclude: ^causalnex/ebaybbn
- 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-causalnex
name: "Quick PyLint on causalnex/*"
language: system
types: [file, python]
files: ^causalnex/
exclude: ^causalnex/ebaybbn
entry: pylint -j0 --disable=unnecessary-pass,cyclic-import --ignore=ebaybbn
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,duplicate-code,no-self-use,invalid-name,cyclic-import
stages: [commit]
# The same pylint checks, but running on all files. It's for manual run with `make lint`
- id: pylint-causalnex
name: "PyLint on causalnex/*"
language: system
pass_filenames: false
stages: [manual]
entry: pylint -j0 --disable=unnecessary-pass,cyclic-import --ignore=ebaybbn causalnex
exclude: ^causalnex/ebaybbn
- id: pylint-tests
name: "PyLint on tests/*"
language: system
pass_filenames: false
stages: [manual]
entry: pylint -j0 --disable=missing-docstring,redefined-outer-name,duplicate-code,no-self-use,invalid-name,cyclic-import tests
# We need to make some exceptions for 3.5, that's why it's a custom runner.
- id: black
name: "Black"
language: system
pass_filenames: false
entry: python -m tools.min_version 3.6 "pip install black" "black causalnex tests"
- id: legal
name: "Licence check"
language: system
pass_filenames: false
entry: make legal