-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
126 lines (118 loc) · 4 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
default_stages: [ commit, merge-commit, push, prepare-commit-msg, commit-msg,
post-checkout, post-commit, post-merge, post-rewrite ]
exclude: |
(?x)(
LICENSE|
\.(html|csv|svg)$|
EAB_tools/tools.py # This is old code
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files # Prevent giant files from being committed.
- id: check-ast # Simply check whether files parse as valid python.
- id: check-case-conflict # Check for files with names that would conflict on a
# case-insensitive filesystem like macOS HFS+ or
# Windows FAT.
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-toml # checks toml files for parsable syntax.
- id: check-yaml # checks yaml files for parsable syntax.
- id: destroyed-symlinks # Detects symlinks which are changed to regular files
# with a content of a path which that symlink was
# pointing to. This usually happens on Windows when a
# user clones a repository that has symlinks, but they
# do not have the permission to create symlinks.
- id: detect-private-key # Checks for the existence of private keys.
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: mixed-line-ending # Replaces or checks mixed line ending.
- id: trailing-whitespace # Trims trailing whitespace.
- repo: https://github.com/psf/black
rev: 24.4.0
hooks:
- id: black-jupyter
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==24.2.6
- flake8-comprehensions==3.14.0
- Flake8-pyproject==1.2.3
args:
- '--extend-ignore=E203'
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy .
language: system
pass_filenames: false
types:
- python
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- --py39-plus
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies:
- toml
- tomli
# Don't let `pre-commit` pass filenames
# Instead, use `pydocstyle`'s default settings from pyproject.toml
pass_filenames: false
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
args: ['--extra-keys=cell.metadata.pycharm']
stages:
- manual
- id: nbstripout
name: nbstripout pycharm metadata
alias: nbstripout-pycharm
args:
- '--extra-keys=cell.metadata.pycharm'
- --keep-output
- --keep-count
- --keep-id
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
hooks:
- id: nbqa-check-ast
- id: nbqa-flake8
additional_dependencies:
- flake8==7.0.0
- flake8-bugbear==24.2.6
- flake8-comprehensions==3.14.0
- Flake8-pyproject==1.2.3
args:
- '--extend-ignore=E203,E402'
- id: nbqa-isort
additional_dependencies:
- isort==5.13.2
- id: nbqa-mypy
additional_dependencies:
- mypy==1.9.0
- matplotlib # for its type hints
exclude: \.py$
- id: nbqa-pyupgrade
additional_dependencies:
- pyupgrade==v3.15.2
args:
- --py39-plus # Synchronize with args in regular hook
- repo: https://github.com/python-jsonschema/check-jsonschema.git
rev: 0.28.2
hooks:
- id: check-github-actions
- id: check-github-workflows