diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f1111d..dfba3f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Change dependency checking to use regex * Clear dialyzer ignores fixed in elixir 1.8.1 * Change format of IO questions +* Add :git_hooks check ## 0.1.2 diff --git a/README.md b/README.md index bcc19de..3ed4aaf 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Contributions welcome. Specifically looking to: * [X] [`:mix_test_watch`](https://github.com/lpil/mix-test.watch) * [X] [`:credo`](https://github.com/rrrene/credo) * [X] [`:excoveralls`](https://github.com/parroty/excoveralls) -* [ ] [`:git_hooks`](https://github.com/qgadrian/elixir_git_hooks) +* [X] [`:git_hooks`](https://github.com/qgadrian/elixir_git_hooks) ### Add Configuration diff --git a/lib/ironman/runner.ex b/lib/ironman/runner.ex index 77db620..d4f6f06 100644 --- a/lib/ironman/runner.ex +++ b/lib/ironman/runner.ex @@ -3,7 +3,7 @@ defmodule Ironman.Runner do alias Ironman.Checks.SimpleDep alias Ironman.{Config, Utils} - @checks [:ex_doc, :earmark, :dialyxir, :mix_test_watch, :credo, :excoveralls] + @checks [:ex_doc, :earmark, :dialyxir, :mix_test_watch, :credo, :excoveralls, :git_hooks] def run do if Utils.check_self_version() == :exit, do: System.halt() @@ -40,6 +40,9 @@ defmodule Ironman.Runner do def run_check(%Config{} = config, :excoveralls), do: config |> SimpleDep.run(:excoveralls, only: :test) |> unwrap(:excoveralls) + def run_check(%Config{} = config, :git_hooks), + do: config |> SimpleDep.run(:git_hooks, only: :test) |> unwrap(:git_hooks) + @spec unwrap({atom(), Config.t()} | {:error, any()}, atom()) :: Config.t() def unwrap({:no, config}, _check), do: config def unwrap({:yes, config}, _check), do: config diff --git a/mix.exs b/mix.exs index 22ab3c1..10486a5 100644 --- a/mix.exs +++ b/mix.exs @@ -36,8 +36,9 @@ defmodule Ironman.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:excoveralls, "~> 0.10.4", only: :test}, - {:credo, "~> 1.0.1-rc1", only: [:dev, :test], runtime: false}, + {:git_hooks, "~> 0.2.0", only: :test}, + {:excoveralls, "~> 0.10.5", only: :test}, + {:credo, "~> 1.0.2", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.19.3", only: :dev, runtime: false}, {:mix_test_watch, "~> 0.9.0", only: :dev, runtime: false}, {:dialyxir, "~> 1.0.0-rc.4", only: [:dev, :test], runtime: false}, diff --git a/mix.lock b/mix.lock index 986ffcc..5938853 100644 --- a/mix.lock +++ b/mix.lock @@ -1,14 +1,15 @@ %{ + "blankable": {:hex, :blankable, "0.0.1", "2e0b4667fee684f0614620d31a34bb2731341cccb27ed903e330195819ba3ba0", [:mix], [], "hexpm"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, "certifi": {:hex, :certifi, "2.4.2", "75424ff0f3baaccfd34b1214184b6ef616d89e420b258bb0a5ea7d7bc628f7f0", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, - "coveralls": {:hex, :coveralls, "2.0.1", "5f4f7a2241514fa5f1ee13ae7759cd9a65337e922f6a46ff9ae7a2a038310a69", [:rebar3], [], "hexpm"}, - "credo": {:hex, :credo, "1.0.1-rc1", "edd92db6a1fd27a704558bb6bcd4a439fb7b8bf82ee1e1a7dad1e56e6ca5a944", [: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.0.2", "88bc918f215168bf6ce7070610a6173c45c82f32baa08bdfc80bf58df2d103b6", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, "dialyxir": {:hex, :dialyxir, "1.0.0-rc.4", "71b42f5ee1b7628f3e3a6565f4617dfb02d127a0499ab3e72750455e986df001", [:mix], [{:erlex, "~> 0.1", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"}, "earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"}, - "erlex": {:hex, :erlex, "0.1.6", "c01c889363168d3fdd23f4211647d8a34c0f9a21ec726762312e08e083f3d47e", [:mix], [], "hexpm"}, + "erlex": {:hex, :erlex, "0.2.0", "80349ebd58553dbd63489937380bfa7d906be3266b91bbd9d2bd6b71f1e8c07d", [:mix], [], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, - "excoveralls": {:hex, :excoveralls, "0.10.4", "b86230f0978bbc630c139af5066af7cd74fd16536f71bc047d1037091f9f63a9", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, + "excoveralls": {:hex, :excoveralls, "0.10.5", "7c912c4ec0715a6013647d835c87cde8154855b9b84e256bc7a63858d5f284e3", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, "file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"}, + "git_hooks": {:hex, :git_hooks, "0.2.0", "3e437954b8dd8d63c723c25b6ae412766ad957a628d2c0aa3fd58cdf941c66c9", [:mix], [{:blankable, "~> 0.0.1", [hex: :blankable, repo: "hexpm", optional: false]}, {:recase, "~> 0.2", [hex: :recase, repo: "hexpm", optional: false]}], "hexpm"}, "hackney": {:hex, :hackney, "1.15.0", "287a5d2304d516f63e56c469511c42b016423bcb167e61b611f6bad47e3ca60e", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, @@ -20,8 +21,7 @@ "mox": {:hex, :mox, "0.4.0", "7f120840f7d626184a3d65de36189ca6f37d432e5d63acd80045198e4c5f7e6e", [:mix], [], "hexpm"}, "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"}, - "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, - "simplehttp": {:hex, :simplehttp, "0.5.1", "103d027c50398b1e2cf26329cd78d8cf55211c17d19e0bb258a7987fe8df3584", [:mix], [], "hexpm"}, + "recase": {:hex, :recase, "0.4.0", "8fb52846f75948156385af2dfdc12f69e5ce27b022a9d1682c70a2fb3ed149c7", [:mix], [], "hexpm"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"}, }