An extension pack for using medic with Elixir projects.
brew tap synchronal/tap
brew install medic-ext-elixir
Example Brewfile
:
tap 'synchronal/tap'
brew 'synchronal/tap/medic'
brew 'synchronal/tap/medic-ext-elixir'
[doctor]
checks = [
{ check = "homebrew" },
{ check = "asdf", command = "plugin-installed", args = { plugin = "erlang" } },
{ check = "asdf", command = "plugin-installed", args = { plugin = "elixir" } },
{ check = "asdf", command = "package-installed", args = { plugin = "erlang" } },
{ check = "asdf", command = "package-installed", args = { plugin = "elixir" } },
{ check = "hex", command = "local-hex" },
{ check = "hex", command = "local-rebar" },
{ check = "hex", command = "packages-installed" },
]
[test]
checks = [
{ name = "Check for warnings", shell = "mix compile --force --warnings-as-errors" },
{ name = "Elixir tests", shell = "mix test --color --warnings-as-errors", verbose = true },
]
[audit]
checks = [
{ step = "elixir", command = "credo" },
{ step = "elixir", command = "dialyzer" },
{ step = "elixir", command = "audit-deps" },
{ check = "elixir", command = "unused-deps" },
]
[outdated]
checks = [
{ check = "elixir" },
]
[update]
steps = [
{ step = "git", command = "pull" },
{ step = "elixir", command = "get-deps" },
{ step = "elixir", command = "compile-deps", args = { mix-env = "dev" } },
{ step = "elixir", command = "compile-deps", args = { mix-env = "test" } },
{ doctor = {} },
{ name = "Migrate", shell = "mix ecto.migrate" },
{ name = "Build docs", shell = "mix docs" },
]
[shipit]
steps = [
{ name = "Check formatting", shell = "mix format --check-formatted" },
{ audit = {} },
{ update = {} },
{ test = {} },
{ step = "git", command = "push" },
{ step = "github", command = "link-to-actions", verbose = true },
]
Checks for whether an Elixir project is configured.
Is the given package installed as a mix archive?
medic-check-elixir archive-installed --name <name>
Is hex installed locally?
medic-check-elixir local-hex
Is rebar installed locally?
medic-check-elixir local-rebar
Are all mix deps compiled for a project?
medic-check-elixir packages-compiled
medic-check-elixir packages-compiled --cd path/to/project
Are all mix deps installed for a project?
medic-check-elixir packages-installed
medic-check-elixir packages-installed --cd path/to/project
Are there any hex deps listed in mix.lock
that are not explicitly
or implicitly listed in mix.exs
?
medic-check-elixir unused-deps
medic-check-elixir unused-deps --cd path/to/project
Check for outdated and updatable hex dependencies.
Steps for updating an Elixir project or for shipping changes to one.
Runs mix deps.audit
, assuming that the mix_audit
package has been added
to a project.
medic-step-elixir audit-deps
medic-step-elixir audit-deps --cd path/to/project
Compiles any dependencies that are not yet compiled. Deps for which mix returns output indicating that the dep is compiled will be skipped.
medic-step-elixir compile-deps
medic-step-elixir compile-deps --cd path/to/project
medic-step-elixir compile-deps --mix-env test
Runs mix credo --strict
.
medic-step-elixir credo
medic-step-elixir credo --cd path/to/project
Runs mix dialyzer
, assuming that the dialyxir
package has been added
medic-step-elixir dialyzer
medic-step-elixir dialyzer --cd path/to/project
o a project.
Downloads any missing dependencies.
medic-step-elixir get-deps
medic-step-elixir get-deps --cd path/to/project