-
Notifications
You must be signed in to change notification settings - Fork 11
/
.pre-commit-config.yaml
99 lines (90 loc) · 2.84 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
default_stages: [pre-commit]
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: local
hooks:
- id: generate-api-client
name: generate-api
entry: ./web/generate-api-typescript-client-pre-commit.sh
language: system
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast
language_version: python3.10
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: trailing-whitespace
exclude: ^web/src/api/generated/|^.*\.(lock)$
- id: end-of-file-fixer
exclude: ^web/src/api/generated/|^.*\.(lock)$
- id: mixed-line-ending
exclude: ^.*\.(lock)$
- id: detect-private-key
exclude: api/src/tests/integration/mock_authentication.py
- id: no-commit-to-branch
args: [--branch, main, --branch, master]
stages: [commit-msg]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.3"
hooks:
- id: ruff
name: Python lint
files: ^api/.*\.py$
args: ["--fix"]
- id: ruff-format
name: Python format
files: ^api/.*\.py$
- repo: https://github.com/biomejs/pre-commit
rev: v0.4.0
hooks:
- id: biome-check
additional_dependencies: [ "@biomejs/biome@1.8.3" ]
args: ["--config-path", "web"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
name: Type checking
args: [--config-file=api/pyproject.toml]
exclude: tests/
additional_dependencies:
- types-cachetools
- types-requests
- types-ujson
- types-toml
- types-click
- types-python-jose
- pymongo
- pydantic
- fastapi
# The path to the venv python interpreter differ between linux and windows. An if/else is used to find it on either.
- repo: local
hooks:
- id: pytest
name: pytest-check
entry: sh -c "if [ -f api/.venv/bin/python ]; then var=api/.venv/bin/python; else var=api/.venv/Scripts/python; fi; $var -m pytest api/src/tests"
language: system
pass_filenames: false
always_run: true
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell --toml=api/pyproject.toml
exclude: documentation/docs/changelog/changelog.md
language: python
types: [text]
additional_dependencies:
- tomli