[settings] lockfile = true # DO NOT FORGET TO `touch mise.lock` if mise.lock does not exist! [tools] go = ['latest', '1.26'] #--- Format # Opinionated Code Formatter. prettier = 'latest' #--- Lint # Static checker for GitHub Actions workflow files. actionlint = 'latest' # Fast linters runner for Go. golangci-lint = 'latest' #--- Test # 'go test' runner with output optimized for humans. gotestsum = 'latest' #--- Release # A highly customizable Changelog Generator that follows Conventional Commit specifications. git-cliff = 'latest' # GitHub's official command line tool. gh = 'latest' [vars] cover = '.cache/cover.out' [tasks.'changelog:skip-commit'] description = 'Add commit hash to .cliffignore to exclude from CHANGELOG' usage = 'arg "" help="Git revision (e.g. HEAD or a1b2c4d)"' run = 'git rev-parse --verify "${usage_commit}" >> .cliffignore' [tasks.fmt] description = 'Format all files' depends = ['fmt:*'] [tasks.lint] description = 'Run all linters' depends = ['lint:*'] [tasks.test] description = 'Run all tests' depends = ['test:*'] [tasks.default] description = 'Run all formatters, linters and tests' depends = ['fmt', 'lint', 'test'] [tasks.ci] description = 'Run all CI tasks' depends = ['fmt', 'lint', 'test'] # Is working tree clean after fmt? run = '! git status --porcelain | tee /dev/stderr | grep -q .' run_windows = 'powershell -c "$status = git status --porcelain; if ($status) { $status; exit 1 }"' [tasks.'fmt:markdown'] description = 'Format markdown files' sources = ['**/*.md'] run = 'prettier --write "**/*.md"' [tasks.'fmt:go'] description = 'Format Go code' run = 'golangci-lint fmt' [tasks.'lint:workflows'] description = 'Lint GitHub Action workflows' run = 'actionlint' [tasks.'lint:markdown'] description = 'Lint markdown files' wait_for = ['fmt:markdown'] sources = ['**/*.md'] run = 'prettier --check "**/*.md"' [tasks.'lint:go'] description = 'Lint Go files' # golangci-lint 2.12.2 (built with go1.26.2) fails to typecheck against the # go1.27 GOROOT (e.g. internal/poll/splice_linux.go), so pin go1.26 here until # golangci-lint is upgraded to a version that supports go1.27. tools = { go = '1.26' } run = 'golangci-lint run' [tasks.'lint:go-compile-windows'] description = 'Check Go test compiles on Windows' run = 'GOOS=windows go test -c -o /dev/null ./...' [tasks.'test:go'] description = 'Run Go tests for a whole project' wait_for = ['lint:*'] # Avoid interleaved output with linters. run = 'gotestsum -- -race -timeout=60s ./...' [tasks.'test:go-1_26'] description = 'Run Go tests for a whole project using the oldest supported Go version' wait_for = ['lint:*'] tools = { go = '1.26' } run = 'gotestsum -- -race -timeout=60s ./...' [tasks.'test:go-submodule'] description = 'Run Go tests in the test/ submodule' wait_for = ['lint:*'] run = 'cd test && gotestsum -- -race -timeout=60s ./...' [tasks.'test:go-submodule-1_26'] description = 'Run Go tests in the test/ submodule using the oldest supported Go version' wait_for = ['lint:*'] tools = { go = '1.26' } run = 'cd test && gotestsum -- -race -timeout=60s ./...' [tasks.'cover:go:total'] description = 'Show Go test coverage total' depends = 'cover:go:generate' run = 'go tool cover -func={{vars.cover}} | tail -n 1 | xargs echo' [tasks.'cover:go:browse'] description = 'Show Go test coverage in a browser' depends = 'cover:go:generate' run = 'go tool cover -html={{vars.cover}}' [tasks.'cover:go:generate'] hide = true depends = 'cachedir' sources = ['**/*.go'] outputs = ['{{vars.cover}}'] run = ''' gotestsum -- \ -coverpkg="$(go list ./... | paste -s -d,)" \ -coverprofile {{vars.cover}} \ ./... go tool cover -html={{vars.cover}} -o {{vars.cover}}.html ''' [tasks.cachedir] hide = true run = 'mkdir -p .cache'