diff --git a/mix.exs b/mix.exs index 2e176a9..07a100a 100644 --- a/mix.exs +++ b/mix.exs @@ -35,16 +35,24 @@ defmodule Sqids.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do List.flatten([ - {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.30", only: :dev, runtime: false}, {:recon, "~> 2.5", only: [:dev, :test], runtime: false}, {:sqids_blocklist, github: "sqids/sqids-blocklist", branch: "main", only: :dev, runtime: false, app: false, compile: false}, + maybe_credo_dep(), maybe_dialyxir_dep(), maybe_styler_dep() ]) end + defp maybe_credo_dep do + if Version.match?(System.version(), "~> 1.12") do + {:credo, "~> 1.7", only: [:dev, :test], runtime: false} + else + [] + end + end + defp maybe_dialyxir_dep do if Version.match?(System.version(), "~> 1.12") do {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}