forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
186 lines (172 loc) · 5.7 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
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
178
179
180
181
182
183
184
185
186
exclude: |
(?x)^(
.*thirdparty/.*|
.*-so_wrap\.(h|c)$
)
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
hooks:
- id: clang-format
files: \.(c|h|cpp|hpp|cc|cxx|m|mm|inc|java|glsl)$
types_or: [text]
exclude: |
(?x)^(
tests/python_build/.*|
platform/android/java/lib/src/com/.*
)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
files: \.py$
types_or: [text]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
types_or: [text]
exclude: |
(?x)^(
.*\.desktop$|
.*\.gitignore$|
.*\.po$|
.*\.pot$|
.*\.rc$|
\.mailmap$|
AUTHORS.md$|
COPYRIGHT.txt$|
DONORS.md$|
core/input/gamecontrollerdb.txt$|
core/string/locales.h$|
editor/project_converter_3_to_4.cpp$|
platform/android/java/lib/src/com/.*|
platform/web/package-lock.json$
)
args:
- --enable-colors
- --write-changes
- --check-hidden
- --quiet-level
- '3'
- --ignore-words-list
- aesthetic,aesthetics,breaked,cancelled,colour,curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,mis,nd,numer,ot,requestor,te,thirdparty,vai
- --builtin
- clear,rare,en-GB_to_en-US
### Requires Docker; look into alternative implementation.
# - repo: https://github.com/comkieffer/pre-commit-xmllint.git
# rev: 1.0.0
# hooks:
# - id: xmllint
# language: docker
# types_or: [text]
# files: ^(doc/classes|.*/doc_classes)/.*\.xml$
# args: [--schema, doc/class.xsd]
- repo: local
hooks:
- id: make-rst
name: make-rst
language: python
entry: python3 doc/tools/make_rst.py doc/classes modules platform --dry-run --color
pass_filenames: false
files: ^(doc/classes|.*/doc_classes)/.*\.xml$
- id: doc-status
name: doc-status
language: python
entry: python3 doc/tools/doc_status.py
files: ^(doc/classes|.*/doc_classes)/.*\.xml$
- id: eslint
name: eslint
language: node
entry: eslint
files: ^(platform/web/js/|modules/|misc/dist/html/).*\.(js|html)$
args: [--fix, --no-warn-ignored, --no-config-lookup, --config, platform/web/eslint.config.cjs]
additional_dependencies:
- '@eslint/js@^9.3.0'
- '@html-eslint/eslint-plugin@^0.24.1'
- '@html-eslint/parser@^0.24.1'
- '@stylistic/eslint-plugin@^2.1.0'
- 'eslint@^9.3.0'
- 'eslint-plugin-html@^8.1.1'
- 'globals@^15.3.0'
- 'espree@^10.0.1'
- id: jsdoc
name: jsdoc
language: node
entry: jsdoc
files: ^platform/web/js/engine/(engine|config|features)\.js$
args:
- --template
- platform/web/js/jsdoc2rst/
- platform/web/js/engine/engine.js
- platform/web/js/engine/config.js
- platform/web/js/engine/features.js
- --destination
- ''
- -d
- dry-run
pass_filenames: false
additional_dependencies: ['jsdoc@^4.0.3']
- id: copyright-headers
name: copyright-headers
language: python
entry: python3 misc/scripts/copyright_headers.py
files: \.(c|h|cpp|hpp|cc|cxx|m|mm|inc|java)$
exclude: |
(?x)^(
core/math/bvh_.*\.inc$|
platform/(?!android|ios|linuxbsd|macos|web|windows)\w+/.*|
platform/android/java/lib/src/com/.*|
platform/android/java/lib/src/org/godotengine/godot/gl/GLSurfaceView\.java$|
platform/android/java/lib/src/org/godotengine/godot/gl/EGLLogWrapper\.java$|
platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix\.java$
)
- id: header-guards
name: header-guards
language: python
entry: python3 misc/scripts/header_guards.py
files: \.(h|hpp)$
exclude: |
(?x)^(
.*/thread\.h$|
.*/platform_config\.h$|
.*/platform_gl\.$h
)
- id: file-format
name: file-format
language: python
entry: python3 misc/scripts/file_format.py
types_or: [text]
exclude: |
(?x)^(
.*\.test\.txt$|
.*\.svg$|
.*\.patch$|
.*\.out$|
modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines\.gd$|
modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment\.notest\.gd$|
modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.notest\.gd$|
platform/android/java/lib/src/com/google/.*
)
- id: dotnet-format
name: dotnet-format
language: python
entry: python3 misc/scripts/dotnet_format.py
types_or: [c#]
# End of upstream Godot pre-commit hooks.
#
# Keep this separation to let downstream forks add their own hooks to this file,
# without running into merge conflicts when rebasing on latest upstream.
#
# Start of downstream pre-commit hooks.
#
# This is still the "repo: local" scope, so new local hooks can be defined directly at this indentation:
# - id: new-local-hook
# To add external repo hooks, bring the indentation back to:
# - repo: my-remote-hook