-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
177 lines (159 loc) · 5.2 KB
/
.pre-commit-config.yaml
File metadata and controls
177 lines (159 loc) · 5.2 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
name: trim trailing whitespace
description: trims trailing whitespace.
entry: trailing-whitespace-fixer
language: python
types: [text]
stages: [pre-commit, pre-push, manual]
- id: end-of-file-fixer
name: fix end of files
description: ensures that a file is either empty, or ends with one newline.
entry: end-of-file-fixer
language: python
types: [text]
stages: [pre-commit, pre-push, manual]
- id: detect-aws-credentials
name: detect aws credentials
description: detects *your* aws credentials from the aws cli credentials file.
entry: detect-aws-credentials
language: python
types: [text]
args:
- "--allow-missing-credentials"
- id: detect-private-key
name: detect private key
description: detects the presence of private keys.
entry: detect-private-key
language: python
types: [text]
- id: check-executables-have-shebangs
name: check that executables have shebangs
description: ensures that (non-binary) executables have a shebang.
entry: check-executables-have-shebangs
language: python
types: [text, executable]
stages: [pre-commit, pre-push, manual]
- id: check-shebang-scripts-are-executable
name: check that scripts with shebangs are executable
description: ensures that (non-binary) files with a shebang are executable.
entry: check-shebang-scripts-are-executable
language: python
types: [text]
stages: [pre-commit, pre-push, manual]
- id: check-json
name: check json
description: checks json files for parseable syntax.
entry: check-json
language: python
files: \.(json|template)$
types: [json]
- id: check-merge-conflict
name: check for merge conflicts
description: checks for files that contain merge conflict strings.
entry: check-merge-conflict
language: python
types: [text]
- id: check-yaml
name: YAML File check
description: Checks if YAML File is valid and there are not any indention errors.
exclude: ^chart/(?:.*/)*.*$
args: [--unsafe]
- id: check-added-large-files
name: check for added large files
description: prevents giant files from being committed.
entry: check-added-large-files
language: python
stages: [pre-commit, pre-push, manual]
args: ["--maxkb=10240"]
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.13.10
hooks:
- id: commitizen
stages: [commit-msg]
# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.15.10"
hooks:
# Run the linter
- id: ruff
files: ^src/backend/(?:.*/)*.*$
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter
- id: ruff-format
files: ^src/backend/(?:.*/)*.*$
# Deps: ensure Python uv lockfile is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.6
hooks:
- id: uv-lock
files: src/backend/pyproject.toml
args: [--project, src/backend]
# Upgrade: upgrade Python syntax
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
# # Lint: code cognitive complexity
# - repo: https://github.com/rohaquinlop/complexipy-pre-commit
# rev: v5.1.0
# hooks:
# - id: complexipy
# Spelling: Checks for common misspellings in text files.
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
types: [text]
args: [--toml, src/backend/pyproject.toml]
# Autoformat: YAML, JSON, Markdown, etc.
- repo: local
hooks:
- id: oxfmt
name: oxfmt
files: ^
entry: bash -c 'test "$#" -gt 0 && oxfmt --write "$@" || exit 0' --
language: node
"types": [text]
additional_dependencies: ["oxfmt@0.35.0"]
args:
[
"!cla.json",
"!src/qfield-plugin/**",
"!src/pnpm-lock.yaml",
"!src/pnpm-workspace.yaml",
"!chart/**",
"!CHANGELOG.md",
"!CONTRIBUTING.md",
"!src/backend/tests/test_data/**",
]
# Lint: GH Workflows
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
args: [-ignore, SC]
# # Lint: Markdown
# - repo: https://github.com/igorshubovych/markdownlint-cli
# rev: v0.47.0
# hooks:
# - id: markdownlint
# args:
# [
# --fix,
# --disable,
# MD059,
# --ignore,
# CHANGELOG.md,
# --ignore,
# .github,
# --ignore,
# src/backend/packages/drone-flightplan/CHANGELOG.md,
# --ignore,
# src/backend/packages/drone-flightplan/LICENSE.md,
# ]