forked from Inky-Station/Inky-Station
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
55 lines (53 loc) · 2.27 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
55 lines (53 loc) · 2.27 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
# TraumaStation's pre-commit.com config
# You don't have to install it yourself, CI applies fixes to PRs automatically (but it's still good to have)
# Use `pip3 install pre-commit` or use your system package.
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v6.0.0"
hooks:
# File checkers
- id: check-yaml
# only check prototypes, maps would be too slow
files: "^Resources/Prototypes/_Trauma/.*\\.yml$"
# !type:... doesn't work without somehow loading SS14, which would probably make commits take years
args: ["--unsafe"]
- id: check-json
# only need to check meta.json files
files: "^Resources/Textures/_Trauma/.*/meta\\.json$"
- id: check-xml
# Check all ui XAML files
# Can't check guidebook "xml" as it is a monster
files: "^Content.Trauma.Client/.*\\.xaml$"
types: ["text"]
- id: check-merge-conflict
# Fixers that can and will change commits to PRs
- id: end-of-file-fixer
- id: trailing-whitespace
- id: fix-byte-order-marker
exclude: "^Resources/Changelog/Changelog.yml$" # BOM removal farms conflicts for every pr changelog
- repo: "local"
hooks:
# Fixers
- id: license-headers-cs
name: "Update License Headers (C#)"
entry: pre_commit_hooks/license-headers.py
language: python
args: ["-c", "^(\\s*//[^\\n]*\\n)*\\s*", "-H", "// SPDX-License-Identifier: AGPL-3.0-or-later"]
# Applies to all modules
files: "^Content\\.(Trauma|Goobstation|Lavaland|Medical)\\..+/.*\\.cs$"
- id: license-headers-xaml
name: "Update License Headers (XAML)"
entry: pre_commit_hooks/license-headers.py
language: python
args: ["-c", "^\\s*(<!--.*?-->)?\\s*", "-H", "<!--\nSPDX-License-Identifier: AGPL-3.0-or-later\n-->"]
# Applies to all modules
files: "^Content\\.(Trauma|Goobstation|Lavaland|Medical)\\..+/.*\\.xaml$"
- id: license-headers-yml
name: "Update License Headers (YML)"
entry: pre_commit_hooks/license-headers.py
language: python
args: ["-c", "^(\\s*#[^\\n]*\\n)*\\s*", "-H", "# SPDX-License-Identifier: AGPL-3.0-or-later"]
# Applies to all prototypes from AGPL codebases
files: "^Resources/Prototypes/_(DV|EinsteinEngines|Goobstation|Lavaland|Mono|NF|Shitmed|SimpleStation|Trauma)/.*\\.yml$"
ci:
autofix_commit_msg: "[pre-commit] automated pr fixes"