forked from equinor/completor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
78 lines (71 loc) · 2.32 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: no-commit-to-branch
args: ['--branch', 'main']
- id: check-json
- id: check-yaml
- id: debug-statements
- id: fix-encoding-pragma
args: [--remove]
- id: end-of-file-fixer
exclude: "tests/completor/data/"
- id: mixed-line-ending
exclude: "tests/completor/data/"
- id: trailing-whitespace
exclude: "tests/completor/data/"
- id: detect-private-key # Checks for private keys
- id: check-docstring-first # Look for code above docstring
- id: check-merge-conflict # Check for merge conflict strings
- id: check-added-large-files # Prevent giant files from being committed
args: ['--maxkb=200']
exclude: "poetry.lock"
# Check poetry validity
- repo: https://github.com/python-poetry/poetry
rev: "1.8.0"
hooks:
- id: poetry-check
# Quick content checks based on grepping for python specific patterns:
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa # Prohibit overly broad QA exclusions.
- id: python-no-eval # Never use eval() it's dangerous.
- id: python-no-log-warn # logger.warning(), not old .warn()
- id: python-use-type-annotations # Enforce that python3.6+ type annotations are used instead of type comments
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
args: ["--settings-path", "pyproject.toml"]
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args: ["--config", "pyproject.toml"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
name: flake8
additional_dependencies: [Flake8-pyproject]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: ["--py310-plus"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
args:
- "--allow-redefinition"
additional_dependencies:
- "numpy<=1.24"
- "types-setuptools==67.2.0.1"
- "pandas-stubs==1.2.0.61"
- "pytest-mypy-plugins==1.9.3"
- "typing-extensions==4.2.0" # May use future type annotations
- "types-tqdm==4.66.0.20240417"