Skip to content

Commit 76145b7

Browse files
authored
feat: add Trunk CI configuration and related files
1 parent d0c72e2 commit 76145b7

File tree

11 files changed

+123
-6
lines changed

11 files changed

+123
-6
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
"esbenp.prettier-vscode",
2323
"streetsidesoftware.code-spell-checker",
2424
"ms-vscode.remote-explorer",
25-
"usernamehw.errorlens"
25+
"usernamehw.errorlens",
26+
"Trunk.io"
2627
]
2728
}
2829
},
29-
"forwardPorts": [
30-
3000
31-
],
30+
"forwardPorts": [3000],
3231
"containerUser": "vscode",
33-
"postCreateCommand": "yarn install",
32+
"postCreateCommand": "yarn install && curl -fsSL https://get.trunk.io -o install.sh && chmod +x install.sh && ./install.sh",
3433
"waitFor": "postCreateCommand", // otherwise automated jest tests fail
3534
"features": {
3635
"node": {

.github/workflows/trunk-check.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Trunk Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "**"
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
trunk:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Install Trunk
21+
run: |
22+
curl -fsSL https://get.trunk.io -o install.sh
23+
chmod +x install.sh
24+
./install.sh
25+
26+
- name: Run Trunk Check
27+
run: trunk check

.trunk/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*out
2+
*logs
3+
*actions
4+
*notifications
5+
*tools
6+
plugins
7+
user_trunk.yaml
8+
user.yaml
9+
tmp

.trunk/configs/.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile=black

.trunk/configs/.markdownlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Prettier friendly markdownlint config (all formatting rules disabled)
2+
extends: markdownlint/style/prettier

.trunk/configs/.shellcheckrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
enable=all
2+
source-path=SCRIPTDIR
3+
disable=SC2154
4+
5+
# If you're having issues with shellcheck following source, disable the errors via:
6+
# disable=SC1090
7+
# disable=SC1091

.trunk/configs/.yamllint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
quoted-strings:
3+
required: only-when-needed
4+
extra-allowed: ["{|}"]
5+
key-duplicates: {}
6+
octal-values:
7+
forbid-implicit-octal: true

.trunk/configs/ruff.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Generic, formatter-friendly config.
2+
select = ["B", "D3", "E", "F"]
3+
4+
# Never enforce `E501` (line length violations). This should be handled by formatters.
5+
ignore = ["E501"]

.trunk/configs/svgo.config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default {
2+
plugins: [
3+
{
4+
name: "preset-default",
5+
params: {
6+
overrides: {
7+
removeViewBox: false, // https://github.com/svg/svgo/issues/1128
8+
sortAttrs: true,
9+
removeOffCanvasPaths: true,
10+
},
11+
},
12+
},
13+
],
14+
};

.trunk/trunk.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
2+
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
3+
version: 0.1
4+
cli:
5+
version: 1.25.0
6+
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
7+
plugins:
8+
sources:
9+
- id: trunk
10+
ref: v1.7.4
11+
uri: https://github.com/trunk-io/plugins
12+
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
13+
runtimes:
14+
enabled:
15+
16+
17+
18+
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
19+
lint:
20+
enabled:
21+
22+
23+
24+
25+
- git-diff-check
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
actions:
38+
enabled:
39+
- trunk-announce
40+
- trunk-check-pre-push
41+
- trunk-fmt-pre-commit
42+
- trunk-upgrade-available

0 commit comments

Comments
 (0)