-
Notifications
You must be signed in to change notification settings - Fork 46
/
.pre-commit-config.yaml
executable file
·58 lines (58 loc) · 1.47 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Prevent committing to the master branch
- id: no-commit-to-branch
args: [--branch, master]
# Format yaml files
- id: check-yaml
# Fix end-of-file issues
- id: end-of-file-fixer
# Fix trailing whitespace
- id: trailing-whitespace
# Prevent debug statements
- id: debug-statements
- id: fix-encoding-pragma
- id: mixed-line-ending
# Code formatting
- repo: https://github.com/ambv/black
rev: 24.2.0
hooks:
- id: black
# Further linting (e.g. module imported but not used)
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
# Verify that requirements.txt is up to date with poetry dependencies every commit
- repo: https://github.com/python-poetry/poetry
rev: 1.8.3
hooks:
- id: poetry-export
args: [
"-f",
"requirements.txt",
"--output",
"requirements.txt",
"--with",
"dev",
"--with",
"test",
"--with",
"docs",
"-E",
"clipboard download express gel",
]
files: 'requirements.txt'
# Remove metadata from jupyter notebooks. This will always be triggered when you commit a change in a notebook.
# Simply do `git add` and commit again.
- repo: local
hooks:
- id: nbstripout
name: nbstripout with keep-output
entry: |
python -m nbstripout --keep-output $@
language: system
files: \.ipynb$
exclude: tests/