-
Notifications
You must be signed in to change notification settings - Fork 54
/
.pre-commit-config.yaml
109 lines (96 loc) · 2.82 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
100
101
102
103
104
105
106
107
108
109
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
types: [file, text]
- id: check-docstring-first
- id: check-case-conflict
- id: end-of-file-fixer
types: [python]
- id: requirements-txt-fixer
- id: mixed-line-ending
types: [python]
args: [--fix=no]
- id: check-added-large-files
args: [--maxkb=2048]
- id: debug-statements
- id: check-byte-order-marker
# - id: check-yaml
- id: check-toml
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
types: [python]
additional_dependencies: ["click==8.0.4"]
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.14.0
hooks:
- id: markdownlint-cli2
- repo: https://github.com/pycqa/flake8.git
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [flake8-print, Flake8-pyproject]
types: [python]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black"]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.7
hooks:
- id: nbqa-black
- id: nbqa-flake8
args: ["--extend-ignore=E203,E402,E501"]
- id: nbqa-isort
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
args:
- --explicit-package-bases
additional_dependencies:
- "types-PyYAML"
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.6.9"
hooks:
- id: ruff
# Serious pylint errors that will be enforced by CI
- repo: https://github.com/pycqa/pylint
rev: v3.3.1
hooks:
- id: pylint
args:
- --errors-only
- --disable=E0401
# Pylint warnings that are bing skipped by CI (see skip: [pylint_warnings] below)
- repo: local
hooks:
- id: pylint_warnings
args: ["--rcfile=.pylintrc.precommit.ini"]
name: pylint-warnings
entry: python -m pylint
language: system
files: \.py$
exclude: clarity/_version.py # 3rd party code that doesn't conform
exclude: ^(tests/regression/_regtest_outputs/) # We don't want these being 'fixed'
ci:
autofix_prs: true
autofix_commit_msg: "[pre-commit.ci] Fixing issues with pre-commit"
autoupdate_schedule: weekly
autoupdate_commit_msg: "[pre-commit.ci] pre-commit-autoupdate"
skip: [pylint_warnings] # Optionally list ids of hooks to skip on CI