Current section
Files
Jump to
Current section
Files
lib/mix/tasks/check.ex
defmodule Mix.Tasks.Check do
@moduledoc false
use Mix.Task
@shortdoc "Runs format, test, and credo checks"
def run(_) do
Mix.Task.run("format", ["--check-formatted"])
# Explicitly set MIX_ENV to "test" for the test task
System.put_env("MIX_ENV", "test")
Mix.Task.run("test", ["--raise"])
# Credo typically runs in the "dev" environment, so set it back
System.put_env("MIX_ENV", "dev")
Mix.Task.run("credo", ["--strict"])
Mix.shell().info("All checks passed!")
end
end