#!/usr/bin/env bash

cat <<'EOF' >mise.toml
[tasks.format]
description = """Format the changed files

If you just want to check the files without automatically fixing them, use the check task."""
usage = 'arg "<file>"'
run = 'echo "$usage_file"'

[tasks.check]
description = "Check the files are formatted"
run = "echo check"
EOF

assert_contains "mise tasks ls --local" "format  Format the changed files..."
assert_not_contains "mise tasks ls --local" "If you just want to check the files"

assert_contains "mise format --help 2>&1 || true" "Format the changed files"
assert_contains "mise format --help 2>&1 || true" "If you just want to check the files without automatically fixing them, use the check task."
assert_contains "mise run format --help 2>&1 || true" "Format the changed files"
assert_contains "mise run format --help 2>&1 || true" "If you just want to check the files without automatically fixing them, use the check task."
