-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
196 lines (161 loc) · 4.56 KB
/
mise.toml
File metadata and controls
196 lines (161 loc) · 4.56 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
[tools]
# Languages
bun = "1"
rust = "1"
# Editors / Formatters
shfmt = "latest"
stylua = "latest"
prettier = "latest"
taplo = "latest"
# Frameworks / SDKs
uv = "0"
[settings]
lockfile = true
lockfile_platforms = ["macos-arm64", "linux-x64"]
minimum_release_age = "7d"
[tasks.check-pre-commit]
description = "Run all pre-commit checks with uv"
run = ["uv sync --group dev", "uv run pre-commit run -a"]
[tasks.format-check-tools]
hide = true
description = "Check required formatters for the repository"
run = '''
set -eu
missing_tools=""
for tool in stylua shfmt prettier taplo; do
if ! command -v "$tool" >/dev/null 2>&1; then
missing_tools="$missing_tools $tool"
fi
done
if [ -n "$missing_tools" ]; then
echo "Missing required formatter(s):$missing_tools" >&2
echo "Install them first, then run: mise run format" >&2
exit 1
fi
'''
[tasks.format-lua]
hide = true
description = "Format Lua files with Stylua"
run = '''
set -eu
tmpfile="$(mktemp)"
trap 'rm -f "$tmpfile"' EXIT
git ls-files -z -- '*.lua' > "$tmpfile"
if [ -s "$tmpfile" ]; then
xargs -0 stylua < "$tmpfile"
fi
'''
[tasks.format-shell]
hide = true
description = "Format shell files with shfmt"
run = '''
set -eu
tmpfile="$(mktemp)"
trap 'rm -f "$tmpfile"' EXIT
git ls-files -z -- '*.sh' '*.bash' '*.zsh' > "$tmpfile"
if [ -s "$tmpfile" ]; then
xargs -0 shfmt -w < "$tmpfile"
fi
'''
[tasks.format-prettier]
hide = true
description = "Format JSON, Markdown, and YAML files with Prettier"
run = '''
set -eu
tmpfile="$(mktemp)"
trap 'rm -f "$tmpfile"' EXIT
git ls-files -z -- \
'*.json' '*.jsonc' '*.md' '*.yaml' '*.yml' \
':(exclude)**/lazy-lock.json' \
':(exclude)**/*.lock' > "$tmpfile"
if [ -s "$tmpfile" ]; then
xargs -0 prettier --write < "$tmpfile"
fi
'''
[tasks.format-toml]
hide = true
description = "Format TOML files with Taplo"
run = '''
set -eu
tmpfile="$(mktemp)"
trap 'rm -f "$tmpfile"' EXIT
git ls-files -z -- \
'*.toml' \
':(exclude)**/*.lock' > "$tmpfile"
if [ -s "$tmpfile" ]; then
xargs -0 taplo fmt < "$tmpfile"
fi
'''
[tasks.format]
description = "Format the repository"
run = [
{ task = "format-check-tools" },
{ tasks = [
"format-lua",
"format-shell",
"format-prettier",
"format-toml",
] },
]
[tasks.link-dotfiles]
hide = true
description = "Link dotfiles-managed files into the home directory"
run = "bash scripts/local/link-dotfiles.sh"
[tasks.sync-global-commands]
hide = true
description = "Link global CLI commands and generate mise task wrappers"
run = "bash scripts/local/sync-global-commands.sh"
[tasks.install-mise-tools]
hide = true
description = "Install tools declared in the local mise configuration"
run = "mise install"
[tasks.install]
description = "Run the dotfiles symlink setup and install configured mise tools"
run = [
{ task = "link-dotfiles" },
{ task = "sync-global-commands" },
{ task = "install-mise-tools" },
{ task = "install-bun" },
{ task = "install-pre-commit" },
]
[tasks.install-bun]
description = "Link Bun globals and install Bun dependencies"
file = "scripts/local/install-bun.sh"
[tasks.relink]
description = "Relink dotfiles-managed symlinks without overwriting real files"
file = "scripts/local/relink-dotfiles.sh"
[tasks.install-pre-commit]
description = "Install the repository pre-commit hook with uv"
file = "scripts/local/install-pre-commit.sh"
[tasks.sync-python]
description = "Sync Python development dependencies with uv"
run = "uv sync --group dev"
[tasks.upgrade]
description = "Upgrade mise-managed tools, Bun globals, and Homebrew packages"
run = [
{ task = "upgrade-mise-tools" },
{ task = "upgrade-nvim-plugins" },
{ task = "upgrade-bun" },
{ task = "upgrade-brew" },
]
[tasks.upgrade-brew]
description = "Upgrade Homebrew packages and sync the tracked Brewfile"
run = ["brew upgrade", "brew bundle dump --file=homebrew/Brewfile --force"]
[tasks.upgrade-bun]
description = "Update Bun global packages to their latest versions"
run = "bun update -g --latest"
[tasks.upgrade-global-tools]
description = "Upgrade global mise tools within their configured version ranges"
run = "mise -C ~ upgrade"
[tasks.upgrade-local-tools]
description = "Upgrade local mise tools within their configured version ranges"
run = "mise upgrade --local"
[tasks.upgrade-mise-tools]
description = "Upgrade local and global mise-managed tools within their configured version ranges"
run = ["mise run upgrade-local-tools", "mise run upgrade-global-tools"]
[tasks.upgrade-nvim-plugins]
description = "Upgrade Neovim plugins managed by lazy.nvim"
run = '''
XDG_CACHE_HOME=/tmp XDG_STATE_HOME=/tmp \
nvim --headless -u nvim/init.lua "+Lazy! update" +qa
'''