Skip to content

refactor(mise): extract 4 tool invocations into [tasks.*] SSOT - #160

Merged
wei18 merged 3 commits into
mainfrom
refactor/mise-tasks-ssot
May 26, 2026
Merged

wei18 merged 3 commits into
mainfrom
refactor/mise-tasks-ssot

Conversation

@wei18

@wei18 wei18 commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

Stage 1 + 2 (combined) of mise tasks SSOT refactor per user 2026-05-26 request. Extract 4 tool invocations from `lefthook.yml` + `lint.yml` + `ci_post_clone.sh` into `.mise.toml [tasks.*]` for single source of truth.

5 tasks defined

Task Purpose Consumers
`lint:swift` swiftlint --quiet (warn-only) lefthook pre-commit
`lint:swift:strict` swiftlint --strict --quiet (warn-fail) GH Actions PR CI
`scan:secrets` gitleaks pre-commit secret scan lefthook
`scan:hygiene` block secret-shaped filenames (.p8/.p12/.pem/.env) lefthook
`gen:acknowledgements` LicensePlist Settings.bundle generation ci_post_clone.sh

Strict-mode handling: Option (b) — two distinct tasks

Resolves the swiftlint flag drift INTENTIONALLY (lefthook = relaxed for dev velocity; CI = strict for merge gate). Each consumer's YAML names which variant it wants — no magic env vars to remember.

Dogfood validation

This commit's own lefthook run executed the refactor:

  • `scan:hygiene` exit 0
  • `scan:secrets` clean (no leaks found)
  • `lint:swift` skipped (no .swift files staged — expected)

6 files, +80/-16.

Closes

  • Backlog idea "抽成 mise task SSOT" (raised + accepted 2026-05-26)

Test plan

  • CI run on next PR: `lint:swift:strict` task invocation works on ubuntu runner via mise
  • Local: `mise run scan:hygiene` runs clean

🤖 Generated with Claude Code

wei18 and others added 3 commits May 26, 2026 17:46
Consolidate duplicated tool invocations across lefthook.yml,
.github/workflows/lint.yml, and ci_scripts/ci_post_clone.sh into
single-source-of-truth task definitions in .mise.toml [tasks.*].

Tasks added:
- lint:swift           (warn-only swiftlint; lefthook)
- lint:swift:strict    (--strict swiftlint; PR CI)
- scan:secrets         (gitleaks; lefthook + ci_post_clone)
- scan:hygiene         (secret-shaped file ls-files guard; lefthook)
- gen:acknowledgements (LicensePlist; ci_post_clone)

Strict-vs-relaxed swiftlint variants are two distinct tasks rather
than one env-flag-conditional task — keeps each task body to a single
command and each consumer's intent self-documenting in YAML.

This commit dogfoods the refactor: lefthook pre-commit now calls
`mise run scan:secrets / scan:hygiene / lint:swift`, proving the
new task wiring works end-to-end.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Convert 5 mise tasks from [tasks.*] inline TOML to file-based per
https://mise.jdx.dev/tasks/file-tasks.html (user preference 2026-05-26):
- mise-tasks/lint/swift
- mise-tasks/lint/swift:strict
- mise-tasks/scan/secrets
- mise-tasks/scan/hygiene
- mise-tasks/gen/acknowledgements

Each file: shebang + #MISE description + set -euo pipefail + exec.
Consumer files (lefthook.yml / lint.yml / ci_post_clone.sh) unchanged —
mise run <task> is source-agnostic.

Subagent could not chmod +x or git update-index --chmod (sandbox);
Leader applied. Commit dogfoods file-based scan:secrets + scan:hygiene
via lefthook.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
- N1 (substantive): ci_post_clone.sh step 2 gitleaks invocation rewired
  from `mise exec aqua:gitleaks/gitleaks -- ...` to `mise run scan:secrets`.
  Closes the third-consumer SSOT gap CR flagged + restores --verbose flag
  parity with lefthook (was dropped on prior version).
- N4 (cosmetic): lefthook.yml inline comment updated — "task bodies live
  in .mise.toml [tasks.*]" → "live in mise-tasks/ as file-based tasks".

N2 (impl-notes BLOCKED → COMPLETE flag) intentionally skipped — impl-notes
lives on worktree, will refresh in next session.
N3 (.mise.toml trailing comment) skipped — comment already correctly
references mise-tasks/, no edit needed.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@wei18
wei18 merged commit ae4acf3 into main May 26, 2026
2 of 3 checks passed
@wei18
wei18 deleted the refactor/mise-tasks-ssot branch May 26, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant