Commit 6f3e2fb
refactor: extract inline shell tasks to mise-tasks file-tasks; add shellcheck + shfmt (#299)
* refactor: extract inline shell tasks to mise-tasks file-tasks; add shellcheck + shfmt
All multi-line inline shell scripts in mise.toml and mise.dev.toml are
moved to standalone executable files under mise-tasks/. Filenames ending
in .sh are used where a directory of the same base name already exists
(test.sh, dev.sh, build/web.sh, test/e2e.sh) so that both the parent
task and its colon-namespaced children can coexist on the filesystem.
New file-tasks added:
mise-tasks/analyze (was inline in mise.toml)
mise-tasks/coverage (was inline in mise.toml)
mise-tasks/test.sh (was inline in mise.toml)
mise-tasks/dev.sh (was inline in mise.dev.toml)
mise-tasks/build/web.sh (was inline in mise.dev.toml)
mise-tasks/serve/release (was inline in mise.dev.toml)
mise-tasks/test/e2e.sh (was inline in mise.dev.toml)
mise-tasks/test/e2e/ui (was inline in mise.dev.toml)
mise-tasks/test/e2e/headed (was inline in mise.dev.toml)
mise-tasks/test/check-page (was inline in mise.dev.toml)
mise-tasks/screenshots/batch (was inline in mise.dev.toml)
shellcheck and shfmt added as mise tools (mise.toml). Two new tasks:
mise-tasks/shell/check — shellcheck on all .sh files + mise-tasks/
mise-tasks/shell/format — shfmt -w on all .sh files + mise-tasks/
shell:check is wired into `check`; shell:format into `format`.
All 22 shell files pass shellcheck; shfmt normalises indentation to tabs.
* refactor: standardise all mise-tasks files with .sh extension
Consistent convention: every file-task in mise-tasks/ has a .sh
extension regardless of whether the name conflicts with a subdirectory.
Previously only conflict cases (test.sh, dev.sh, build/web.sh,
test/e2e.sh) had the extension.
Renamed:
analyze -> analyze.sh
coverage -> coverage.sh
build/web/prod -> build/web/prod.sh
dev/tunnel -> dev/tunnel.sh
serve/release -> serve/release.sh
setup/playwright -> setup/playwright.sh
setup/tunnel -> setup/tunnel.sh
shell/check -> shell/check.sh
shell/format -> shell/format.sh
test/check-page -> test/check-page.sh
test/e2e/headed -> test/e2e/headed.sh
test/e2e/ui -> test/e2e/ui.sh
Also adds mise-tasks/screenshots/ gitignore exception (the screenshots/
rule was blocking mise-tasks/screenshots/batch.sh from being tracked),
and simplifies shell:check / shell:format to a single find *.sh pass
now that the grep-for-shebang fallback is no longer needed.
* fix: use #USAGE headers for task args; pin shellcheck/shfmt versions
Replace broken #MISE usage= multi-line strings with the correct #USAGE
per-line syntax (the format mise actually parses for argument docs).
Reverts positional-arg fallback back to $usage_* env vars now that
the header syntax is correct.
Also pins shellcheck = "0.9.0" and shfmt = "3.8.0" instead of "latest"
so mise tools resolve without hitting GitHub releases API.
* feat: pass args through test and analyze tasks; update descriptions
Both tasks now forward $@ so agents can run a subset without resorting
to mise exec:
mise run test test/widgets/drink_card_test.dart
mise run analyze lib/screens/
Descriptions rewritten to answer "when to run" rather than "what it does",
and to clarify that the log file is auto-created (not a required input).
AGENTS.md updated to show the task form instead of the mise exec workaround.
* fix: scope shellcheck/shfmt as task-level tools; drop from global [tools]
Declaring them in [tools] caused mise to attempt installation on every
task run, blocking all tasks when GitHub's API is rate-limited.
Moving them to #MISE tools={} in the tasks that actually need them means
they're only resolved for shell:check and shell:format.
* fix: suppress flutter root warning; fix set -e masking grep hints on failure
The "Woah! You appear to be running flutter as root" warning on stderr
was filtered out with grep -v in the test/analyze/coverage pipelines.
Also fixes a latent bug: set -euo pipefail caused the script to exit
immediately on flutter failure, so the "Grep with:" hint was never
printed on failure — exactly when it's most needed. Replaced with
set -uo pipefail and EXIT_CODE=${PIPESTATUS[0]} to capture flutter's
exit code while letting the hint always print.
* fix: add export mode to get_version_info.sh; fix comments and error message
- get_version_info.sh: add 'export' mode (eval-safe VAR=value lines)
that prod.sh was already calling but was falling through to the
human-readable default, causing eval to fail on the "Version: ..."
output. Also switch == to = in [ ] comparisons (shellcheck SC2039).
- serve/release.sh: error hint now points to the correct
MISE_ENV=dev ./bin/mise invocation instead of bare `mise`.
- mise.dev.toml: update task→file mapping comments to include .sh
extension to match the actual committed filenames.
* fix: drop deprecated #MISE tools={system}; exclude .mise/ from shell scans
'system' version in #MISE tools={} is deprecated in mise. Removing the
declaration entirely — shellcheck and shfmt are expected on PATH (install
via apt/brew). Also adds -not -path "./.mise/*" to the find commands so
the Flutter SDK's own shell scripts in .mise/http-tarballs/ are not
included in shellcheck/shfmt runs.
* fix: restore shellcheck/shfmt to [tools] for mise-managed installation
'system' is not a valid mise version. The correct approach is to pin
versions in [tools] so mise installs and manages them. In environments
where they are already available (e.g. this sandbox, devcontainers),
set MISE_DISABLE_TOOLS=shellcheck,shfmt to skip installation and use
the PATH versions instead.
* fix: use printf %q for shell-safe eval output in export mode
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 11f744f commit 6f3e2fb
22 files changed
Lines changed: 218 additions & 178 deletions
File tree
- mise-tasks
- build
- web
- dev
- screenshots
- serve
- setup
- shell
- test
- e2e
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
147 | 148 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments