-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
145 lines (139 loc) · 3.83 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
# pre-commit install
# pre-commit run --all-files
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types:
- pre-commit
- commit-msg
exclude: "^{{cookiecutter.project_name}}"
repos:
# * Top level
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-yaml
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
# * sync dependencies
# Put this first, because messes up formatting
- repo: https://github.com/mxr/sync-pre-commit-deps
rev: v0.0.1
hooks:
- id: sync-pre-commit-deps
# * Prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
hooks:
- id: prettier
stages: [commit]
additional_dependencies:
- prettier-plugin-toml
exclude: ^requirements/lock/.*[.]yml
# * Markdown
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.9.2
hooks:
- id: markdownlint-cli2
args: ["--style prettier"]
# * Linting
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.0.289"
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
# NOTE: nbQA for notebook formatting
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.9.1
# exclude: ^README.md
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-ruff
additional_dependencies: [ruff==0.0.289]
- id: nbqa-black
additional_dependencies: [black==23.9.1]
# * Commit message
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.9.0
hooks:
- id: commitizen
stages: [commit-msg]
# * Manual Linting ------------------------------------------------------------
# * isort, pyupgrade, flake8 defer to ruff
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
stages: [manual]
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
stages: [manual]
args: [--py38-plus]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
stages: [manual]
additional_dependencies:
- flake8-docstrings
- Flake8-pyproject
# - pep8-naming
# - flake8-rst-docstrings
exclude: ^tests/|^src/mypackage/tests/|^docs/conf.py|^setup.py
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade]
stages: [manual]
args: [--py38-plus]
- id: nbqa-isort
additional_dependencies: [isort]
stages: [manual]
# ** spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
types_or: [python, rst, markdown, cython, c]
additional_dependencies: [tomli]
args: [-I, docs/spelling_wordlist.txt]
stages: [manual]
# - repo: local
# hooks:
# - id: mypy
# name: mypy
# entry: tox
# args: ["-e", "lint-mypy"]
# language: system
# pass_filenames: false
# # additional_dependencies: [tox]
# types: [python]
# require_serial: true
# stages: [manual]
# - id: pyright
# name: pyright
# entry: pyright
# args: []
# language: system
# pass_filenames: true
# # additional_dependencies: [tox]
# types: [python]
# require_serial: true
# stages: [manual]