diff --git a/.travis.yml b/.travis.yml index b20dbdc..dccd138 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,12 +13,13 @@ before_install: - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin install: - - mix local.rebar --force; + - mix local.rebar --force - mix local.hex --force - mix deps.get +script: - mix format --check-formatted - mix credo -script: + - mix hex.outdated - mix test deploy: skip_cleanup: true diff --git a/config/dev.exs b/config/dev.exs index 6597213..eb21d14 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -21,3 +21,6 @@ config :divo, } } } + +config :husky, + pre_commit: "mix format --check-formatted && mix credo && mix hex.outdated" diff --git a/lib/divo/helper.ex b/lib/divo/helper.ex index 68fb282..f60cc33 100644 --- a/lib/divo/helper.ex +++ b/lib/divo/helper.ex @@ -20,9 +20,8 @@ defmodule Divo.Helper do """ @spec fetch_config() :: map() | String.t() | [tuple()] def fetch_config() do - with {:ok, config} <- Application.fetch_env(fetch_name(), :divo) do - config - else + case Application.fetch_env(fetch_name(), :divo) do + {:ok, config} -> config :error -> raise ArgumentError, message: "no services were defined in application config" end end diff --git a/mix.exs b/mix.exs index dd95348..597b76d 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Divo.MixProject do def project do [ app: :divo, - version: "1.1.6", + version: "1.1.7", elixir: "~> 1.8", start_permanent: Mix.env() == :prod, deps: deps(), @@ -25,12 +25,13 @@ defmodule Divo.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:credo, "~> 1.0", only: [:dev, :test], runtime: false}, + {:credo, "~> 1.1", only: [:dev, :test], runtime: false}, {:jason, "~> 1.1"}, {:placebo, "~> 1.2", only: [:dev, :test]}, {:ex_doc, "~> 0.19", only: :dev}, {:patiently, "~> 0.2"}, - {:temporary_env, "~> 2.0", only: [:dev, :test]} + {:temporary_env, "~> 2.0", only: [:dev, :test]}, + {:husky, "~> 1.0", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index 375da27..fafb793 100644 --- a/mix.lock +++ b/mix.lock @@ -1,8 +1,9 @@ %{ "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, - "credo": {:hex, :credo, "1.0.5", "fdea745579f8845315fe6a3b43e2f9f8866839cfbc8562bb72778e9fdaa94214", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, + "credo": {:hex, :credo, "1.1.0", "e0c07b2fd7e2109495f582430a1bc96b2c71b7d94c59dfad120529f65f19872f", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, "earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58beb77f20f21ee3558cc3c753743ae0ddbb0fd7ba2912331", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, + "husky": {:hex, :husky, "1.0.1", "c4859acf68849c219e2114da5795861a7183facc3b141c47432a9deb0032169e", [:mix], [{:poison, ">= 1.2.1", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, "makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, "makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"},