-
Notifications
You must be signed in to change notification settings - Fork 27
/
.pre-commit-config.yaml
60 lines (56 loc) · 1.92 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
---
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- --line-length=120
- --ignore=E731,E501,W605,UP038
# See https://beta.ruff.rs/docs/rules for an overview of ruff rules
- --select=E,W,F,I,T,RUF,TID,UP
- --fixable=E,W,F,I,T,RUF,TID,UP
- --target-version=py310
- --exclude=cognite/client/_proto
- id: ruff-format
args:
- --line-length=120
- --exclude=cognite/client/_proto*
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: debug-statements
- id: check-docstring-first
- repo: local
hooks:
- id: mypy
name: mypy
# Eventually we want to run mypy on the whole test code base. But for now we only enable it for data modeling tests.
entry: |
poetry run dmypy run -- cognite tests/tests_integration/test_api/test_data_modeling
tests/tests_unit/test_data_classes/test_data_models
files: ^.*.(py|pyi)$
language: system
pass_filenames: false
- repo: local
hooks:
- id: custom-checks
name: custom repo checks
entry: poetry run python scripts/run_checks.py
files: ^cognite/.*.(py|pyi)$
language: system
pass_filenames: true
require_serial: true # avoid possible race conditions
- repo: https://github.com/jsh9/pydoclint # Run after 'custom-checks' as these may auto-fix
rev: 0.5.14
hooks:
- id: pydoclint
require_serial: true # Spammy in run-all scenarios (more than fast enough already)
args:
- --style=google
- --exclude=tests/|scripts/
- --quiet # otherwise prints all checked files that are ok...
- --skip-checking-raises=true
- --check-class-attributes=false