-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
60 lines (56 loc) · 1.74 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
default_install_hook_types: ["pre-commit", "pre-push"]
exclude: >
(?x)(
LICENSE$
)
repos:
# Many of these hooks are local because people use a variety of IDEs
# with autoformatters that need to call out to things like `black` directly.
# pre-commit run is not the same, and something like pre-commit exec does
# not exist yet.
- repo: local
hooks:
# Configuration for black exists in pyproject.toml,
# but we let pre-commit take care of the file filtering.
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
# Configuration for isort exists in pyproject.toml,
# but we let pre-commit take care of the file filtering.
- id: isort
name: isort
entry: isort
language: system
types: [python]
# Configuration for flake8 exists in setup.cfg,
# but we let pre-commit take care of the file filtering.
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
- id: prevent-push
name: prevent pushing to main
stages: [push]
entry: bash -c 'test "$PRE_COMMIT_REMOTE_BRANCH" != "refs/heads/main"'
always_run: true
pass_filenames: false
language: system
# Strips output from jupyter notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
hooks:
- id: nbstripout
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements