-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.pre-commit-config.yaml
127 lines (115 loc) · 3.23 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
#######################################################################
# INSTALLATION AND USAGE:
#
# pre-commit install
#
# pre-commit autoupdate
# run this periodically to update revision versions
# pre-commit run --all-files
# manually run on all files in repo, not just staged ones
#
# SKIPPING:
#
# git commit --no-verify
# commit skipping the pre-commit hooks
#
# SKIP=mypy,flake8 git commit -m "my commit message"
# The SKIP environment variable is a comma separated list of hook ids
# see https://pre-commit.com/#temporarily-disabling-hooks
#
# pm-version 0.3.0
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#######################################################################
default_language_version:
python: python3.8
repos:
# MISC
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: ipynb$
- id: requirements-txt-fixer
- id: detect-private-key
- id: detect-aws-credentials
- id: check-ast
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=50']
- id: no-commit-to-branch
# AUTOFLAKE - removes unused imports and unused variables.
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports']
# see: https://github.com/myint/autoflake#advanced-usage
# BLACK
- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black
# BLACK_NBCONVERT
- repo: https://github.com/dfm/black_nbconvert
rev: 'v0.3.0'
hooks:
- id: black_nbconvert
# DOCKER-COMPOSE-CHECK
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v2.0.1
hooks:
- id: docker-compose-check
# FLAKE8
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-copyright
# INTERROGATE
- repo: https://github.com/econchick/interrogate
# cf http://www.pydocstyle.org/en/stable/index.html
rev: 1.4.0
hooks:
- id: interrogate
args: [ -vv, --config=pyproject.toml ]
# see https://github.com/econchick/interrogate/issues/60
pass_filenames: false
# ISORT
- repo: https://github.com/pre-commit/mirrors-isort
rev: 'v5.9.3'
hooks:
- id: isort
args: ["--settings-path", "pyproject.toml"]
# MYPY
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910'
hooks:
- id: mypy
# verbose: true
# args: [--ignore-missing-imports]
additional_dependencies:
# - boto3-stubs[s3]>=1.18
# - mypy-boto3-s3>=1.18
# - types-orjson>=0.1.1
- types-pytz>=2021.1.0
# - types-requests>=2.25.0
# PYTEST
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest
args: [
--cov=.,
--cov-config=pyproject.toml,
--continue-on-collection-errors,
--durations=5,
--no-cov-on-fail,
]
language: system
pass_filenames: false