I am trying to enforce callback and Spec check through Credo. As such it is working good as a linter for our project’s needs and want to expand our usage further. My understanding is Credo.Check.Readability.Specs — Credo v1.7.2 will notify (default priority = 0) if there are specs not defined right. I did the following
- Added
{Credo.Check.Readability.Specs, [priority: :high, exit_status: 2]}
to.credo.exs
bumping up the priority and making credo to fail by setting exit status to 2. - Added a couple of methods exactly like in the documentation, just to see that Readability specs will catch inconsistencies in spec definition. My expectation was the check will catch the fact that spec definition for add/2 is wrong and that there is NO spec definition for add/1 . But it doesn’t report it as an issue atall. How do I go about enforcing @spec and @callback errors in Credo?
@spec add(integer, String.t) :: String.t
def add(a, b), do: a + b
def add(a), do: a + a