Skip to content

Commit

Permalink
Mark unused match variable with _ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Janix4000 committed Nov 8, 2022
1 parent 481bb76 commit a991414
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions lib/unifex/specs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,26 @@ defmodule Unifex.Specs do
enums: Keyword.get_values(config, :enum),
structs: Keyword.get_values(config, :struct)
}
|> Enum.flat_map(fn
[doc: {_meta, doc}, function: function] ->
[{function, doc}]
[{:doc, {meta, doc}}, _not_a_function] ->
line_number = meta[:line]
Logger.warning( "Found @doc in file #{specs_file}:#{line_number} that does not correspond to any function.")
[]
[_prev_term, function: function] ->
[{function, false}]
_else ->
[]
end)
|> Keyword.new(fn {{name, _args, _results}, doc} -> {name, doc} end)
|> Enum.flat_map(fn
[doc: {_meta, doc}, function: function] ->
[{function, doc}]

[{:doc, {meta, _doc}}, _not_a_function] ->
line_number = meta[:line]

Logger.warning(
"Found @doc in file #{specs_file}:#{line_number} that does not correspond to any function."
)

[]

[_prev_term, function: function] ->
[{function, false}]

_else ->
[]
end)
|> Keyword.new(fn {{name, _args, _results}, doc} -> {name, doc} end)
end

# Returns a clean __ENV__ with proper functions/macros imported. Useful for invoking
Expand Down

0 comments on commit a991414

Please sign in to comment.