View Source Warnex (warnex v0.1.0)
This module is meant to assist in ordering the warnings outputted by this application.
Initially, you must gather the warnings from the compilation output:
rm warnings.log; mix compile --force --all-warnings > warnings.log 2>&1
OR
alias Warnex
Warnex.generate_warnings()
Summary
Functions
Shows all warning counts for all files with warnings
Returns the total amount of errors for a specific file
Returns the warnings for a specific file lookup
Returns all warnings where the existing warning contains the given string
Runs the compilation process and generates the warnings.log file. Returns :ok if successful, {:error, reason} if the command fails.
Gives you the next n file warnings
Parses the log output of a compilation into maps
Describes the total warnings for all files that have warnings
Functions
Shows all warning counts for all files with warnings
Examples
iex(1)> Warnex.count
8
Returns the total amount of errors for a specific file
Example
iex(1)> Warnex.count("shared_view.ex")
1
Returns the warnings for a specific file lookup
Examples
iex(1)> Warnex.for_file("shared_view.ex")
[
%{
message: "missing parentheses for expression following "else:" keyword. Parentheses are required to solve ambiguity inside keywords.",
location: %{
line: 11,
filename: "shared_view.ex",
path: "lib/application_web/views"
}
},
%{...},
...
]
Returns all warnings where the existing warning contains the given string
Examples
iex(1)> Warnex.for_warning("missing parentheses for expression")
%{
"shared_view.ex" => [
%{
message: "missing parentheses for expression following "else:" keyword. Parentheses are required to solve ambiguity inside keywords.",
location: %{
line: 11,
filename: "shared_view.ex",
path: "lib/application_web/views"
}
}
],
"..." => [...]
}
Runs the compilation process and generates the warnings.log file. Returns :ok if successful, {:error, reason} if the command fails.
Examples
iex> Warnex.generate_warnings()
:ok
Gives you the next n file warnings
Examples
iex(1)> Warnex.next(5)
[
[
%{
message: "missing parentheses for expression following "else:" keyword. Parentheses are required to solve ambiguity inside keywords.",
location: %{
line: 11,
filename: "shared_view.ex",
path: "lib/application_web/views"
}
}
],
[...],
...
]
Parses the log output of a compilation into maps
Examples
iex(1)> Warnex.parse_warnings()
[
%{
message: "missing parentheses for expression following "else:" keyword. Parentheses are required to solve ambiguity inside keywords.",
location: %{
line: 11,
filename: "shared_view.ex",
path: "lib/application_web/views"
}
},
%{...},
...
]
Describes the total warnings for all files that have warnings
Examples
iex(1)> Warnex.summary
[
["shared_view.ex", 1],
["page_controller.ex", 1],
["items.ex", 1],
]