-
Notifications
You must be signed in to change notification settings - Fork 28
/
.pre-commit-config.yaml
162 lines (140 loc) · 4.49 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
repos:
################
# GENERAL CHECKS
################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files
name: Large Files Check
args: ["--maxkb=1024"]
- id: detect-aws-credentials
name: Check AWS Credentials
args:
- "--allow-missing-credentials"
- id: detect-private-key
name: Check Private Keys
- id: check-merge-conflict
name: Merge Conflict Resolution Check
- id: end-of-file-fixer
name: Newline EOF Checker
- id: fix-byte-order-marker
name: Fix UTF-8 byte order marker
- id: trailing-whitespace
name: Whitespace Cleaning Check
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
hooks:
- id: shfmt
name: Shell Script Format
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
name: GitLeaks Checks
- repo: https://github.com/sirosen/fix-smartquotes
rev: 0.2.0
hooks:
- id: fix-smartquotes
name: Fix Quotes
############
# CODE LINT
############
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
hooks:
- id: markdownlint-cli2
name: Markdown Lint
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
name: Dockerfile Lint
args: ["--config", ".hadolint.yaml"]
- repo: local
hooks:
- id: eslint
name: ESLint
language: system
entry: sh -c 'npm --prefix src/leapfrogai_ui/ run lint'
files: \.(js|jsx|ts|tsx|svelte|cjs|mjs)$ # *.js, *.jsx, *.ts, *.tsx, *.svelte, *.cjs, *.mjs
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff # Run the linter.
name: Ruff Lint
- id: ruff-format # Run the formatter.
name: Ruff Format
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
name: Helm Lint
exclude: "packages/supabase"
#############
# UDS v0.14.0
#############
# ZARF PACKAGE CHECK
- repo: local
hooks:
- id: download-schema
name: "Download Zarf Schema"
entry: |
bash -c 'FILE="zarf-v0.14.0.schema.json"
if [ -f "$(git rev-parse --show-toplevel)/$FILE" ]; then
echo "$FILE already exists in the root of the git project, skipping download."
else
curl -o "$FILE" https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.16.0/zarf.schema.json
fi'
language: system
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.0
hooks:
- id: check-jsonschema
name: "Validate Zarf Configs Against Schema"
files: "zarf.yaml"
types: [yaml]
args: ["--schemafile", "zarf-v0.14.0.schema.json"]
# UDS BUNDLE CHECK
- repo: local
hooks:
- id: download-schema
name: "Download UDS Bundle Schema"
entry: |
bash -c 'FILE="uds-v0.14.0.schema.json"
if [ -f "$(git rev-parse --show-toplevel)/$FILE" ]; then
echo "$FILE already exists in the root of the git project, skipping download."
else
curl -o "$FILE" https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.16.0/uds.schema.json
fi'
language: system
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.0
hooks:
- id: check-jsonschema
name: "Validate UDS Bundles Against Schema"
files: "uds-bundle.yaml"
types: [yaml]
args: ["--schemafile", "uds-v0.14.0.schema.json"]
# UDS TASKS CHECK
- repo: local
hooks:
- id: download-schema
name: "Download UDS Tasks Schema"
entry: |
bash -c 'FILE="tasks-v0.14.0.schema.json"
if [ -f "$(git rev-parse --show-toplevel)/$FILE" ]; then
echo "$FILE already exists in the root of the git project, skipping download."
else
curl -o "$FILE" https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.16.0/tasks.schema.json
fi'
language: system
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.0
hooks:
- id: check-jsonschema
name: "Validate UDS Bundles Against Schema"
files: "tasks.yaml"
types: [yaml]
args: ["--schemafile", "tasks-v0.14.0.schema.json"]