-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
148 lines (133 loc) · 3.58 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
148 lines (133 loc) · 3.58 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
exclude: |
(?x)^(
docs/conf.py|
.*/style_set_23_06_14/.*|
.*/style_set_24_01_30/.*|
.*/test_here_qgis_plugin/ui/example/.*|
.*/resources_rc.py|
.*/resources.py|
\.git.*|
HERE_NOTICE|
\.scan-report.html
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)^(
setup.cfg|
.*.bumpversion.cfg
)$
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
args: ['--allow-multiple-documents']
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
## If you want to automatically "modernize" your Python code:
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.7.0
# hooks:
# - id: pyupgrade
# args: ['--py37-plus']
## If you want to avoid flake8 errors due to unused vars or imports:
# - repo: https://github.com/PyCQA/autoflake
# rev: v2.1.1
# hooks:
# - id: autoflake
# args: [
# --in-place,
# --remove-all-unused-imports,
# --remove-unused-variables,
# ]
- &isort
repo: https://github.com/PyCQA/isort
rev: 5.11.5
hooks:
- id: isort
args: [ "--profile", "black", "--filter-files" ]
- &black
repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.3.0
hooks:
- id: black
language_version: python3.9
args: [ -v ]
## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.13.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
## You can add flake8 plugins via `additional_dependencies`:
additional_dependencies: [flake8-bugbear]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
alias: flake8-html
name: flake8-html
args: [--format, html, --htmldir, reports]
## You can add flake8 plugins via `additional_dependencies`:
additional_dependencies: [flake8-bugbear, flake8-html]
stages: [manual]
## Check for misspells in documentation files:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
# hooks:
# - id: codespell
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292 # must match test-requirements.txt
hooks:
- id: ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292 # must match test-requirements.txt
hooks:
- id: ruff
alias: ruff-fix
args: [ --fix ]
#- *isort
#- *black
- repo: https://github.com/twisted/towncrier
rev: 24.8.0
hooks:
- id: towncrier-check
args: [ --config, towncrier.toml ]
files: 'changelog/(?:here_qgis|here_qgis_plugin)/.*\.md$'
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.330
hooks:
# - id: pyright
# args: [--createstub, here_qgis, --verbose]
- id: pyright
args: [here_qgis]
stages: [manual]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.5.1'
hooks:
- id: mypy
alias: stubgen
name: stubgen
entry: stubgen
args: [-p, here_qgis, -o, typings]
pass_filenames: false
additional_dependencies: [tokenize-rt==3.2.0]
stages: [manual]
- id: mypy
alias: mypy-only
args: [--strict, --ignore-missing-imports, -p, here_qgis]
pass_filenames: false
additional_dependencies: [tokenize-rt==3.2.0]
stages: [manual]