Credo.Check.Consistency.Collector.find_locations_not_matching
You're seeing just the callback
find_locations_not_matching
, go back to Credo.Check.Consistency.Collector module for more information.
Specs
find_locations_not_matching( expected :: term(), source_file :: Credo.SourceFile.t() ) :: [term()]
issue_formatter
may call the @collector.find_locations_not_matching/2
function to obtain additional metadata for each occurrence of
an unexpected match in a given file.
An example implementation that returns a list of line numbers on which unexpected occurrences were found:
def find_locations_not_matching(expected, source_file) do
traverse(source_file, fn(match, line_no, acc) ->
if match != expected do
acc ++ [line_no]
else
acc
end
end)
end
defp traverse(source_file, fun), do: ...