-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.toml
133 lines (105 loc) · 3.72 KB
/
tasks.toml
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
# ref: https://mise.jdx.dev/tasks/
#:schema https://mise.jdx.dev/schema/mise-task.json
[commit]
depends = ["buni:root"]
run = ["git add .", "bun run git-cz"]
["commit:staged"]
depends = ["buni:root"]
run = "bun run git-cz"
[check]
depends = ["check:*"]
["check:biome"]
run = "biome {% if env.LINT is undefined %}check --write{% else %}ci{% endif %} --error-on-warnings"
["check:tsc"]
depends = ["buni"]
run = [
"bun run tsc {% if env.CI is defined %}--incremental false{% endif %}",
"bun run --cwd worker tsc --project tsconfig.base.json {% if env.CI is defined %}--incremental false{% endif %}",
"bun run --cwd worker tsc --project tsconfig.src.json {% if env.CI is defined %}--incremental false{% endif %}",
"bun run --cwd worker tsc --project tsconfig.test.json {% if env.CI is defined %}--incremental false{% endif %}",
]
["check:jsonschema"]
# schema of wrangler.jsonc is in node_modules
depends = ["buni:worker"]
run = "jschema-validator"
["check:actionlint"]
run = "actionlint -color"
# SC2312: check-extra-masked-returns
# pipefail is set by shell: bash in GitHub Actions but cannot be detected by shellcheck
# ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell
env = { "SHELLCHECK_OPTS" = "--enable=all --exclude=SC2312" }
["check:ghalint"]
wait_for = ["check:pinact"]
run = "ghalint run"
["check:pinact"]
run = "pinact run --verify"
depends_post = [
"{% if env.CI is defined %}util:nodiff{% else %}util:donothing{% endif %}",
]
["check:taplo"]
run = [
"taplo lint",
"taplo fmt {% if env.LINT is defined %}--check --diff{% endif %}",
]
["check:prettier"]
run = """
prettier {% if env.LINT is undefined %}--write{% else %}--check{% endif %} \
{% if env.CI is undefined %}--cache{% endif %} ."""
["check:markdownlint"]
run = "markdownlint-cli2 {% if env.LINT is undefined %}--fix{% endif %}"
["check:shfmt"]
# cannot exclude gitignored files
# ref: https://github.com/mvdan/sh/issues/288
run = """
shfmt {% if env.LINT is undefined %}--list --write{% else %}--diff{% endif %} \
--simplify {{ exec(command='mise run util:list-scripts') }}"""
["check:shellcheck"]
# recursive globbing is not supported
# ref: https://www.shellcheck.net/wiki/Recursiveness
# ref: https://github.com/koalaman/shellcheck/issues/143
run = "shellcheck --external-sources {{ exec(command='mise run util:list-scripts') }}"
["check:yamlfmt"]
run = "yamlfmt {% if env.LINT is defined %}-lint{% endif %} ."
["check:yamllint"]
run = "yamllint --strict ."
["check:cspell"]
run = "cspell {% if env.CI is undefined %}--cache{% endif %} \"**/*\""
["check:lychee"]
run = """
lychee {% if env.LINT is defined %}--verbose{% endif %} \
{% if env.CI is undefined %}--cache{% endif %} \"**/*\""""
["check:typos"]
run = "typos {% if env.LINT is undefined %}--write-changes{% endif %}"
["check:ignore-sync"]
run = "ignore-sync ."
depends_post = [
"{% if env.CI is defined %}util:nodiff{% else %}util:donothing{% endif %}",
]
["worker:dev"]
depends = ["buni:worker"]
dir = "worker"
run = "bun run wrangler dev ${{ exec(command='mise run worker:wrangler-args') }}"
["worker:test"]
depends = ["buni:worker"]
run = "bun run vitest {% if env.CI is undefined %}watch --ui{% else %}run{% endif %}"
dir = "worker"
["buni"]
depends = ["buni:root", "buni:worker"]
["buni:root"]
run = "bun install --frozen-lockfile"
hide = true
["buni:worker"]
run = "bun install --frozen-lockfile"
dir = "worker"
hide = true
["util:nodiff"] # cspell:ignore nodiff
run = ["git add .", "git diff --staged --exit-code"]
hide = true
# cspell:ignore donothing
["util:donothing"]
run = ""
hide = true
["util:list-scripts"]
# .bashrc is not detected by shfmt --find
run = "git_files=$(git ls-files) && scripts=$(shfmt --find $git_files) && echo wsl/home/.bashrc $scripts"
hide = true