Skip to content

Commit fd7984d

Browse files
committed
ci: add Trunk.io lint/format config
1 parent 66d0d56 commit fd7984d

1 file changed

Lines changed: 185 additions & 0 deletions

File tree

trunk.yaml

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Trunk.io — Unified linting, formatting, and security
2+
# Docs: https://docs.trunk.io/check/reference
3+
# This replaces per-language linter configs with a single source of truth
4+
5+
version: 0.1
6+
cli:
7+
version: 1.22.12
8+
9+
# Trunk plugins to enable
10+
plugins:
11+
sources:
12+
- id: trunk
13+
ref: v1.6.6
14+
- id: trunk-fmt
15+
ref: v1.2.1
16+
17+
# Linter configurations
18+
linters:
19+
# --- RUST ---
20+
- name: rustfmt
21+
enabled: true
22+
direct_configs:
23+
- rustfmt.toml
24+
- .rustfmt.toml
25+
26+
- name: clippy
27+
enabled: true
28+
direct_configs:
29+
- clippy.toml
30+
- .clippy.toml
31+
32+
# --- PYTHON ---
33+
- name: ruff
34+
enabled: true
35+
args: ["--config", "pyproject.toml"]
36+
direct_configs:
37+
- ruff.toml
38+
- pyproject.toml
39+
40+
- name: mypy
41+
enabled: true
42+
direct_configs:
43+
- mypy.ini
44+
- setup.cfg
45+
- pyproject.toml
46+
47+
- name: bandit
48+
enabled: true
49+
args: ["-c", "pyproject.toml"]
50+
51+
- name: black
52+
enabled: true
53+
direct_configs:
54+
- pyproject.toml
55+
56+
# --- GO ---
57+
- name: golangci-lint
58+
enabled: true
59+
direct_configs:
60+
- .golangci.yml
61+
- .golangci.yaml
62+
- golangci-lint.yaml
63+
64+
- name: gofmt
65+
enabled: true
66+
67+
- name: goimports
68+
enabled: true
69+
70+
# --- TYPESCRIPT/JAVASCRIPT ---
71+
- name: biome
72+
enabled: true
73+
direct_configs:
74+
- biome.json
75+
- biome.jsonc
76+
77+
- name: eslint
78+
enabled: true
79+
direct_configs:
80+
- .eslintrc.js
81+
- .eslintrc.json
82+
- .eslintrc.yml
83+
- eslint.config.js
84+
85+
- name: prettier
86+
enabled: true
87+
direct_configs:
88+
- .prettierrc
89+
- .prettierrc.json
90+
- .prettierrc.yml
91+
- prettier.config.js
92+
93+
# --- DOCKER ---
94+
- name: hadolint
95+
enabled: true
96+
direct_configs:
97+
- hadolint.yaml
98+
99+
# --- YAML ---
100+
- name: yamllint
101+
enabled: true
102+
103+
# --- MARKDOWN ---
104+
- name: markdownlint
105+
enabled: true
106+
direct_configs:
107+
- .markdownlint.json
108+
109+
# --- SECURITY ---
110+
- name: gitleaks
111+
enabled: true
112+
113+
# --- GENERAL ---
114+
- name: shellcheck
115+
enabled: true
116+
117+
- name: actionlint
118+
enabled: true
119+
120+
- name: trufflehog
121+
enabled: true
122+
123+
# Formatter configurations
124+
formatters:
125+
- name: rustfmt
126+
enabled: true
127+
direct_configs:
128+
- rustfmt.toml
129+
130+
- name: ruff
131+
enabled: true
132+
args: ["format"]
133+
direct_configs:
134+
- pyproject.toml
135+
136+
- name: black
137+
enabled: true
138+
139+
- name: gofmt
140+
enabled: true
141+
142+
- name: goimports
143+
enabled: true
144+
145+
- name: biome
146+
enabled: true
147+
args: ["format"]
148+
149+
- name: prettier
150+
enabled: true
151+
152+
- name: shfmt
153+
enabled: true
154+
args: ["-i", "2", "-ci"]
155+
156+
# Action definitions (CI commands)
157+
actions:
158+
- name: checkout
159+
type: git_clone
160+
161+
- name: install
162+
type: plugin
163+
path: trunk-install
164+
165+
# Ignored patterns
166+
ignore:
167+
- paths:
168+
- node_modules/
169+
- .venv/
170+
- venv/
171+
- __pycache__/
172+
- target/
173+
- dist/
174+
- build/
175+
- .git/
176+
- vendor/
177+
- "*.lock"
178+
- "go.sum"
179+
type: include
180+
181+
# CI configuration
182+
ci:
183+
enabled: true
184+
notify:
185+
- trunk-io

0 commit comments

Comments
 (0)