forked from hotosm/drone-tm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
153 lines (138 loc) · 4.64 KB
/
.pre-commit-config.yaml
File metadata and controls
153 lines (138 loc) · 4.64 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
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/(?:.*/)*.*$
- 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"]
# Deps: ensure Python uv lockfile is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.28
hooks:
- id: uv-lock
files: src/backend/pyproject.toml
args: [--project, src/backend]
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.12.1
hooks:
- id: commitizen
stages: [commit-msg]
# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.14.14"
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/(?:.*/)*.*$
# Spelling: Checks for common misspellings in text files.
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
types: [text]
args: [--toml, src/backend/pyproject.toml]
# Autoformat: YAML, JSON, Markdown, etc.
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.6.2
hooks:
- id: prettier
args:
[
--ignore-unknown,
--no-error-on-unmatched-pattern,
"!src/frontend/**",
"!chart/**",
"!CHANGELOG.md",
"!CONTRIBUTING.md",
"!src/frontend/pnpm-lock.yaml",
"!src/backend/tests/test_data/**",
"!src/frontend/**",
]
# # 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,
# ]