Skip to content

Instantly share code, notes, and snippets.

@leandrocp
Last active June 6, 2019 14:20
Show Gist options
  • Save leandrocp/b37276fd04f61643d2fc307ab9b71053 to your computer and use it in GitHub Desktop.
Save leandrocp/b37276fd04f61643d2fc307ab9b71053 to your computer and use it in GitHub Desktop.
elixir_code_mix.exs
defmodule YourProject.MixProject do
use Mix.Project
def project do
[
app: :your_project,
version: "0.1.0",
elixir: "~> 1.6",
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [warnings_as_errors: true],
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
dialyzer: [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
ignore_warnings: ".dialyzer_ignore.exs"
]
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {YourProject.Application, []},
extra_applications: [:logger, :runtime_tools]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.4.3"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
# dev, test
{:credo, "~> 1.0", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0.0-rc.6", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.7", only: [:dev, :test], runtime: false}
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
quality: ["format", "credo --strict", "sobelow --verbose", "dialyzer", "test"],
"quality.ci": [
"test",
"format --check-formatted",
"credo --strict",
"sobelow --exit",
"dialyzer --halt-exit-status"
],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment