forked from naev/naev
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
160 lines (160 loc) · 4.66 KB
/
.pre-commit-config.yaml
File metadata and controls
160 lines (160 loc) · 4.66 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
minimum_pre_commit_version: '3.2.0'
repos:
- repo: local
hooks:
- id: trailing-whitespace.sh
name: trim trailing whitespace (bash)
entry: utils/shlinters/trailing-whitespace.sh
types: [text]
language: script
- id: end-of-file-fixer.sh
name: fix end of files (bash)
entry: utils/shlinters/end-of-file-fixer.sh
types: [text]
language: script
exclude: po/naevpedia.pot
- id: line-endings.sh
name: mixed line endings (bash)
entry: utils/shlinters/line-endings.sh
types: [text]
language: script
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
#- id: trailing-whitespace
#- id: end-of-file-fixer
# exclude: po/naevpedia.pot
- id: check-xml
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: check-executables-have-shebangs
#- id: check-shebang-scripts-are-executable
- id: check-case-conflict
#- id: check-symlinks
#- id: check-illegal-windows-names
#- id: destroyed-symlinks
- id: detect-private-key
#- id: mixed-line-ending
#- id: pretty-format-json
- id: check-merge-conflict
args: [--assume-in-merge]
- repo: local
hooks:
- id: check_luadoc_func
name: check @lua.. not used outside @luafunc
entry: utils/check_luadoc_funcs.sh
files: '^src/nlua_*.c'
types: [c]
language: script
- id: luafunc_dup
name: duplicate @luafunc entry detector
entry: utils/luafunc_dup.sh
files: '^src/nlua_*.c'
types: [c]
language: script
- id: rem_xml_head
name: remove unnecessary XML 1.0 headers
entry: utils/rem_xml_head.sh
types: [xml]
language: script
exclude: org.naev.Naev.metainfo.xml
- id: doxspell
name: doxspell
entry: utils/doxspell.sh
language: script
types: [c]
- id: expand-tabs.sh
name: expand tabs (bash)
entry: utils/shlinters/expand-tabs.sh
exclude: (^|/)Makefile
language: script
types: [text]
- id: reindent
name: reindent
entry: utils/reindent.sh
#[build clang-format dot frag glsl gltf js lua luacheckrc markdown md nsi py pov rb scm sh tex vdf vert]
# Unmanaged: [markdown md yaml yml .clangformat]
files: .*\.build$|.*\.dot$|.*\.frag$|.*\.glsl$|.*\.gltf|.*\.js$|.*\.lua$|.*\.luacheckrc$|.*\.nsi$|.*\.py$|.*\.pov$|.*\.rb$|.*\.scm$|.*\.sh$|.*\.tex$|.*\.vdf$|.*\.vert$
language: script
- id: check_fmt_f_usage
name: lua f-string validation
entry: utils/check_fmt_f_usage.py
files: '^dat/'
types: [lua]
language: python
- id: potfiles
name: check for stale POTFILES.in
entry: utils/update-po.sh
args: [".", ".", "--pre-commit"]
language: script
always_run: true
pass_filenames: false
- id: xml_format
name: format xml
entry: utils/xml_format.sh
types: [xml]
files: .*\.(xml|loc|plist)$
args: ["-st"]
language: script
# - id: glsl_validator
# name: glsl validator
# entry: utils/nglslValidator.py
# files: dat/.*\.(frag|vert)$
# language: python
- id: rustfmt
name: Rust formatter
entry: rustfmt
types: [rust]
files: '^src/'
args: ["--edition", "2024"]
language: system
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
types: [shell]
- repo: local
hooks:
- id: u_codespell
name: u_codespell
entry: utils/shlinters/parallel.sh
files: '^dat/'
types_or: [xml, lua]
language: script
args: ["2", "-b", "utils/shlinters/u_codespell/u_codespell", "-u", ".u_codespell_unmatch", "--"]
require_serial: true
#- repo: https://github.com/codespell-project/codespell
# rev: v2.4.1
# hooks:
# - id: codespell
# files: '^dat/'
# types_or: [xml, lua]
- repo: local
hooks:
- id: clang-format
name: Clang formatter
entry: utils/clf.sh
types: [c]
files: '^src/'
language: script
- id: luacheckrc_extractor
name: Extractor for generated luacheckrc API
entry: utils/luacheckrc_extractor.sh
always_run: true
args: ["--output", "utils/luacheckrc_gen.lua"]
language: script
- id: nluacheck
name: wrapper for luacheck that understands Naev hooks
entry: utils/nluacheck.py
files: '^dat/'
types: [lua]
language: python
- repo: https://github.com/shssoichiro/oxipng
rev: v9.1.5
hooks:
- id: oxipng
args: ["-o", "max", "--strip", "safe", "--alpha"]
types: [png]