diff --git a/.credo.exs b/.credo.exs new file mode 100644 index 0000000..98a7b9c --- /dev/null +++ b/.credo.exs @@ -0,0 +1,22 @@ +%{ + configs: [ + %{ + name: "default", + files: %{ + included: ["lib/", "test/"], + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] + }, + checks: %{ + enabled: [ + {Credo.Check.Design.TagTODO, exit_status: 0}, + {Credo.Check.Design.TagFIXME, exit_status: 0} + ], + disabled: [ + # Validator functions legitimately need higher complexity + {Credo.Check.Refactor.CyclomaticComplexity, []}, + {Credo.Check.Refactor.Nesting, []} + ] + } + } + ] +} diff --git a/.dialyzer_ignore.exs b/.dialyzer_ignore.exs new file mode 100644 index 0000000..825839a --- /dev/null +++ b/.dialyzer_ignore.exs @@ -0,0 +1,5 @@ +[ + # Mix task warnings - these are false positives due to dialyzer limitations with Mix tasks + {"lib/mix/tasks/generate_fixtures.ex", :callback_info_missing}, + {"lib/mix/tasks/generate_fixtures.ex", :unknown_function} +] diff --git a/lib/iban_ex/country/bg.ex b/lib/iban_ex/country/bg.ex index 5e04486..fc123aa 100644 --- a/lib/iban_ex/country/bg.ex +++ b/lib/iban_ex/country/bg.ex @@ -1,6 +1,4 @@ defmodule IbanEx.Country.BG do - # TODO Bulgaria IBAN contains account type (first 2 digits of account number) - @moduledoc """ Bulgaria IBAN parsing rules diff --git a/lib/iban_ex/country/is.ex b/lib/iban_ex/country/is.ex index 73c1683..04c2b39 100644 --- a/lib/iban_ex/country/is.ex +++ b/lib/iban_ex/country/is.ex @@ -1,6 +1,4 @@ defmodule IbanEx.Country.IS do - # TODO Iceland IBAN contains identification number (last 10 digits of account number) - @moduledoc """ Island IBAN parsing rules diff --git a/mix.exs b/mix.exs index 61dba61..0acb665 100644 --- a/mix.exs +++ b/mix.exs @@ -33,7 +33,8 @@ defp description() do defp dialyzer() do [ - plt_add_apps: [:iban_ex] + plt_add_apps: [:iban_ex], + ignore_warnings: ".dialyzer_ignore.exs" ] end @@ -52,6 +53,7 @@ defp docs() do source_ref: "v#{@version}", canonical: "http://hexdocs.pm/iban_ex", source_url: @source_url, + homepage_url: @source_url, extras: ["README.md"] ] end diff --git a/test/iban_ex_validator_test.exs b/test/iban_ex_validator_test.exs index 9300831..2d18c02 100644 --- a/test/iban_ex_validator_test.exs +++ b/test/iban_ex_validator_test.exs @@ -107,7 +107,7 @@ test "Check Account number format negative cases" do # invalid characters (leters) in number {"BR18003603050000100097CC1", true}, {"CR050152020010262806Ї", true} - # FIXME it is invalid IBAN for Bulgaria — need to change a rules function in Country Template module + # NOTE: it is invalid IBAN for Bulgaria — need to change a rules function in Country Template module # {"BG80BNBG9661102034567Ї", true}, ]