-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pre-commit-config.yaml
89 lines (89 loc) · 3.24 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
---
# See https://pre-commit.com for more information
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
# NOTE: Leave these artifacts as they are, it will only create trouble
# with GA commits where these tools are not installed.
- id: end-of-file-fixer
exclude: |
(?x)^(
data/intel-mediasdk-gcc13\.patch|
npm-generated-sources\.json|
nuget-generated-sources-arm64\.json|
nuget-generated-sources-x64\.json
)$
# NOTE: Disabled because it fails at:
# could not determine a constructor for the tag '!=:'
#- id: check-yaml
- id: check-added-large-files
# non-default
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
#- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: detect-private-key
- id: mixed-line-ending
# NOTE: Disabled, there is currently no use for this.
#- id: pretty-format-json
# args: ["--autofix"]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
args: ["--color=always", "--external-sources"]
types: ["file", "shell", "text"]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
hooks:
- id: shfmt
args: ["--diff", "--indent", "2", "--binary-next-line", "--space-redirects", "--case-indent"]
#types: ["executable", "file", "shell", "text"]
types: ["file", "shell", "text"]
exclude: |
(?x)^(
path/to/file\.py
)$
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
args: ["--no-banner"]
- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
hooks:
- id: actionlint
- repo: https://github.com/woodruffw/zizmor
rev: v0.5.0
hooks:
- id: zizmor
files: ^\.github/workflows/.*\.ya?ml$
# NOTE: It looks like community maintainers have given up on maintaining the
# prettier pre-commit hook. Therefore we integrate it in the makefile.
# This takes a few seconds longer, but it is so wasteful and embarrassing when a builder fails with a linter error.
- repo: local
hooks:
- id: flatpak-builder-lint
name: Flatpak Builder Lint
entry: flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest
language: system
#types: [manifest]
types: ["file", "non-executable", "text", "yaml"]
files: org.jellyfin.JellyfinServer.yml
require_serial: true
# Use a wrapper while the program exits with 0: https://github.com/priv-kweihmann/systemdlint/issues/75
- repo: local
hooks:
- id: systemdlint
name: Systemd Unit Lint
#entry: systemdlint
entry: bash -c 'OUTPUT=$(systemdlint "$@" 2>&1); EXIT_CODE=$?; echo "$OUTPUT"; if [[ -n "$(echo "$OUTPUT" | grep -v "^$")" ]]; then exit 1; else exit 0; fi' --
language: system
files: \.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$
require_serial: true