-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pre-commit-config.yaml
122 lines (105 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
112
113
114
115
116
117
118
119
120
121
122
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude: .ipynb
# - id: check-added-large-files
# args: [ "--maxkb=500" ]
- id: check-merge-conflict
- id: trailing-whitespace
- id: requirements-txt-fixer
- id: check-yaml
- id: check-toml
- id: forbid-submodules
- id: name-tests-test
args: ["--pytest-test-first"]
- id: no-commit-to-branch
args: ["--branch", "master"]
#-- https://github.com/Pocco81/auto-save.nvim - repo: https://gitlab.com/devopshq/gitlab-ci-linter
# # Find and use latest tag
# # https://gitlab.com/devopshq/gitlab-ci-linter/-/tags
# rev: v1.0.5
# hooks:
# - id: gitlab-ci-linter
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args: [ --py39-plus ]
- repo: https://github.com/python/black
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
files: ".ipynb"
args: [--drop-empty-cells]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.286'
hooks:
- id: ruff
- id: ruff
alias: ruff-with-fix
args: [--fix]
stages: [manual]
# applies code formatting on Jupyter notebooks:
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-isort
additional_dependencies: [isort==5.12.0]
- id: nbqa-black
additional_dependencies: [black==23.10.1]
- id: nbqa-ruff
additional_dependencies: [ruff==0.0.286]
args: [--ignore=B018, --ignore=W605]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
hooks:
- id: mypy
args: [--ignore-missing-imports, --no-implicit-optional, --allow-redefinition]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
- id: rst-directive-colons
types: [text] # overwrite types: [rst]
types_or: [python, rst]
- id: rst-inline-touching-normal
types: [text] # overwrite types: [rst]
types_or: [python, rst]
# TODO: install
#- repo: https://github.com/fsfe/reuse-tool
# rev: v1.1.2
# hooks:
# - id: reuse
- repo: local
hooks:
- id: bibliography
name: bibliography
# || true --> Ignore failure if venv could not be activated
entry: sh -c "(. .venv/bin/activate || true) && python3 doc/source/verify_bibliography.py"
language: system
always_run: true
pass_filenames: false
# TODO: potential future hooks
#- repo: https://github.com/fsfe/reuse-tool
# rev: v1.1.2
# hooks:
# - id: reuse
# Style checker for sphinx (or other) rst documentation.
#- repo: https://github.com/pycqa/doc8
# rev: 0.11.1
# hooks:
# - id: doc8
#- repo: https://github.com/myint/rstcheck
# rev: v3.3.1
# hooks:
# - id: rstcheck