Move lint, precommit, shellcheck from mix aliases to mise scripts

Mix aliases should only compose mix tasks. Shell tool orchestration
(shellcheck, fd) belongs in mise scripts. This removes the mix cmd
escape hatch and makes the boundary clear: mix.exs for pure mix
composition, scripts/ for cross-toolchain orchestration.
This commit is contained in:
Claudio Ortolina
2026-04-12 12:30:59 +01:00
parent 65135a618d
commit 4a8af7be39
5 changed files with 39 additions and 32 deletions
+1 -1
View File
@@ -1 +1 @@
Run the full pre-commit check pipeline (`mix precommit`) and report the results. If any check fails, identify the specific failure and suggest a fix. Run the full pre-commit check pipeline (`mise run dev:precommit`) and report the results. If any check fails, identify the specific failure and suggest a fix.
+5 -4
View File
@@ -34,7 +34,6 @@
"Bash(mix run:*)", "Bash(mix run:*)",
"Bash(sqlite3:*)", "Bash(sqlite3:*)",
"WebSearch", "WebSearch",
"Bash(mix shellcheck:*)",
"Bash(mix compile:*)", "Bash(mix compile:*)",
"mcp__tidewave__get_docs", "mcp__tidewave__get_docs",
"mcp__tidewave__search_package_docs", "mcp__tidewave__search_package_docs",
@@ -69,9 +68,12 @@
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__get_console_message", "mcp__plugin_chrome-devtools-mcp_chrome-devtools__get_console_message",
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__hover", "mcp__plugin_chrome-devtools-mcp_chrome-devtools__hover",
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__press_key", "mcp__plugin_chrome-devtools-mcp_chrome-devtools__press_key",
"mcp__plugin_chrome-devtools-mcp_chrome-devtools__wait_for" "mcp__plugin_chrome-devtools-mcp_chrome-devtools__wait_for",
"Bash(mise generate:*)",
"Bash(shellcheck:*)"
] ]
}, },
"enableAllProjectMcpServers": false,
"hooks": { "hooks": {
"PostToolUse": [ "PostToolUse": [
{ {
@@ -91,6 +93,5 @@
] ]
} }
] ]
}, }
"enableAllProjectMcpServers": false
} }
-25
View File
@@ -27,12 +27,6 @@ defmodule MusicLibrary.MixProject do
] ]
end end
def cli do
[
preferred_envs: [precommit: :test]
]
end
# Specifies which paths to compile per environment. # Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"] defp elixirc_paths(_), do: ["lib"]
@@ -142,15 +136,6 @@ defmodule MusicLibrary.MixProject do
# See the documentation for `Mix` for more info on aliases. # See the documentation for `Mix` for more info on aliases.
defp aliases do defp aliases do
[ [
precommit: [
"shellcheck",
"credo --strict",
"sobelow --compact --exit",
"gettext.extract --check-up-to-date",
"format --check-formatted",
"deps.unlock --unused",
"test"
],
setup: [ setup: [
"deps.get", "deps.get",
"ecto.setup", "ecto.setup",
@@ -161,16 +146,6 @@ defmodule MusicLibrary.MixProject do
], ],
"ecto.setup": ["ecto.create", "ecto.migrate"], "ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"], "ecto.reset": ["ecto.drop", "ecto.setup"],
shellcheck: [
"cmd fd . 'scripts/' --exclude '*.hurl' -t file --exec shellcheck --color",
"cmd fd . '.claude/hooks' -t file --exec shellcheck --color"
],
lint: [
"format",
"credo",
"gettext.extract --merge",
"shellcheck"
],
# When running the migrate task WITHOUT setting the log_level option, # When running the migrate task WITHOUT setting the log_level option,
# Ecto defaults to debug IRRESPECTIVELY of the log level set in # Ecto defaults to debug IRRESPECTIVELY of the log level set in
# config/test.exs. The debug log level persists while the first 2-3 # config/test.exs. The debug log level persists while the first 2-3
+12 -1
View File
@@ -8,4 +8,15 @@ source "$(git rev-parse --show-toplevel)/scripts/_helpers.sh"
ensure_working_directory! ensure_working_directory!
mix lint debug_msg "Formatting..."
mix format
debug_msg "Running credo..."
mix credo
debug_msg "Extracting translations..."
mix gettext.extract --merge
debug_msg "Running shellcheck..."
fd . 'scripts/' --exclude '*.hurl' -t file --exec shellcheck --color
fd . '.claude/hooks' -t file --exec shellcheck --color
+21 -1
View File
@@ -8,4 +8,24 @@ source "$(git rev-parse --show-toplevel)/scripts/_helpers.sh"
ensure_working_directory! ensure_working_directory!
mix precommit debug_msg "Running shellcheck..."
fd . 'scripts/' --exclude '*.hurl' -t file --exec shellcheck --color
fd . '.claude/hooks' -t file --exec shellcheck --color
debug_msg "Running credo..."
mix credo --strict
debug_msg "Running sobelow..."
mix sobelow --compact --exit
debug_msg "Checking translations..."
mix gettext.extract --check-up-to-date
debug_msg "Checking formatting..."
mix format --check-formatted
debug_msg "Checking unused deps..."
mix deps.unlock --unused
debug_msg "Running tests..."
mix test