forked from equinor/data-modelling-storage-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
65 lines (60 loc) · 1.79 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
default_stages: [ pre-commit ]
default_install_hook_types: [ pre-commit, commit-msg ]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^.*\.(lock)$||^docs\/
- id: end-of-file-fixer
exclude: ^.*\.(lock)$||^docs\/
- id: mixed-line-ending
exclude: ^.*\.(lock)$||^docs\/
- id: detect-private-key
exclude: src/tests/test_helpers/mock_token_generator.py
- id: check-ast
language_version: python3.12
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-yaml
- id: check-toml
- id: pretty-format-json
args:
[ --autofix, --no-sort-keys, "--top-keys=_id,name,type,description" ]
- id: no-commit-to-branch
args: [ --branch, master ]
stages: [ commit-msg ]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.4.0
hooks:
- id: conventional-pre-commit
stages: [ commit-msg ]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.3'
hooks:
- id: ruff-format
name: Code formatting
files: ^src/.*\.py$
- id: ruff
name: Code linting
files: ^src/.*\.py$
args:
- --fix
- --unsafe-fixes
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
hooks:
- id: mypy
name: Type checking
args: [ --config-file=./pyproject.toml ]
additional_dependencies:
- types-redis
- types-cachetools
- types-requests
- repo: local
hooks:
- id: pytest
name: Unit Tests
entry: sh -c "export PYTHONPATH=./src && .venv/bin/python -m pytest src/tests"
language: system