-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
59 lines (59 loc) · 1.78 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
default_stages: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: check-toml
- id: trailing-whitespace
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/crate-ci/typos
rev: v1.24.6
hooks:
- id: typos
- repo: https://github.com/commitizen-tools/commitizen # better commit messages
rev: v3.29.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/astral-sh/ruff-pre-commit # python lint + format
rev: v0.6.7
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
stages: [pre-commit, pre-push]
- id: ruff-format
types_or: [python, pyi, jupyter]
# all the stuff after this comment is slow, so it is ran only on pushes
- repo: local
hooks:
# it is important to run this hook before pyright, to sync the venv
- id: python-deps
name: Install python deps
stages: [pre-push]
types: [python, pyi, jupyter]
entry: poetry install
language: system
pass_filenames: false
always_run: true
- repo: https://github.com/RobertCraigie/pyright-python # python typecheck
rev: v1.1.381
hooks:
- id: pyright
stages: [pre-push]
types_or: [python, pyi, jupyter]
- repo: local
hooks:
- id: pytest # testing: but only on push (nice)
name: Testing with pytest
stages: [pre-push]
types: [python, pyi, jupyter]
entry: poetry run pytest -m "not slow" .
language: system
pass_filenames: false
always_run: true