-
Notifications
You must be signed in to change notification settings - Fork 68
/
.pre-commit-config.yaml
111 lines (110 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
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: [pre-commit]
repos:
#
# Formatting
#
# NOTE: checks that adjust files are marked with the special "manual" stage
# and "require_serial" so that we can easily call them via `make`
#
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
# - id: check-executables-have-shebangs (issues in devcontainer)
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
require_serial: true
stages: [pre-commit, manual]
# TODO:
#- id: pretty-format-json
# args: [--autofix, --no-sort-keys]
# require_serial: true
# stages: [pre-commit, manual]
- id: trailing-whitespace
require_serial: true
stages: [pre-commit, manual]
- repo: https://github.com/johann-petrak/licenseheaders
rev: v0.8.8
hooks:
- id: licenseheaders
files: '\.(sh|cmd|ps1|sql|py)$'
args: [-t, doc/mit-license.tmpl, -E, .py, .sh, .ps1, .sql, .cmd, -x, mlos_bench/setup.py, mlos_core/setup.py, mlos_viz/setup.py, -f]
require_serial: true
stages: [pre-commit, manual]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py310-plus]
require_serial: true
stages: [pre-commit, manual]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
require_serial: true
stages: [pre-commit, manual]
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
require_serial: true
stages: [pre-commit, manual]
- repo: https://github.com/PyCQA/docformatter
rev: 06907d0 # v1.7.5
hooks:
- id: docformatter
require_serial: true
stages: [pre-commit, manual]
#
# Linting
#
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
types: [python]
# Use pylint and mypy from the local (conda) environment so that vscode can reuse them too.
- repo: local
hooks:
- id: pycodestyle
name: pycodestyle
entry: pycodestyle
language: system
types: [python]
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [
"-j0",
"--rcfile=pyproject.toml",
"-rn", # Only display messages
"-sn", # Don't display the score
]
exclude: |
(?x)^(
doc/source/conf.py
)$
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
exclude: |
(?x)^(
doc/source/conf.py|
mlos_core/setup.py|
mlos_bench/setup.py|
mlos_viz/setup.py|
conftest.py
)$
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes