View Source hank_utils (rebar3_hank v1.4.1)
Link to this section Summary
Functions
Returns a MFA tuple for given application node
Same as attr_args/3 but calling erl_syntax:concrete/1 for each element
Macro dodging version of erl_syntax:attribute_name/1
Format rule result text for console output
Get the function definition name and arity of a given Function Node.
Get the function name of a given Function Node.
Get the function definition tuple {name, arity} of a given Function Node.
Before OTP 23.2 test suites implemented an _implicit_ behavior. The only way to figure out that a module was actually a test suite was by its name.
Get the macro arity of given Node
Get the macro definition name and arity of a given Macro Node.
Generates a macro from the variable that's used in a control flow attribute. e.g. returns ?MACRO if it receives -ifdef(MACRO).
Get the parsed macro name of given Node
Returns true if the node contains the atom. Only analyzes functions and attributes.
Whether the given Node node has defined the given AttrNames attribute names or not
Returns the line number of the given node
Whether one of the given paths is contained inside the other one or not. It doesn't matter which one is contained at which other. Verifies if FilePath and IncludePath refer both to the same file. Note that we can't just compare both filename:absname's here, since we don't really know what is the absolute path of the file referred by the include directive.
Link to this section Functions
-spec application_node_to_mfa(erl_syntax:syntaxTree()) -> undefined | {unknown | string(), unknown | string(), [erl_syntax:syntaxTree()]} | {string(), [erl_syntax:syntaxTree()]}.
-spec attr_args_concrete(erl_syntax:forms(), atom() | [atom()]) -> [term()].
-spec attr_name(erl_syntax:syntaxTree()) -> atom() | string() | term().
-spec format_text(string(), list()) -> binary().
-spec function_description(erl_syntax:syntaxTree()) -> string().
-spec function_name(erl_syntax:syntaxTree()) -> string().
-spec function_tuple(erl_syntax:syntaxTree()) -> {atom(), pos_integer()}.
-spec is_old_test_suite(file:filename()) -> boolean().
-spec macro_arity(erl_syntax:syntaxTree()) -> none | pos_integer().
-spec macro_definition_name(erl_syntax:syntaxTree()) -> {string(), integer() | atom()}.
-spec macro_from_control_flow_attr(erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec macro_name(erl_syntax:syntaxTree()) -> unknown | string().
-spec node_has_atom(erl_syntax:syntaxTree(), atom()) -> boolean().
-spec node_has_attrs(erl_syntax:syntaxTree(), atom() | [atom()]) -> boolean().
-spec node_line(erl_syntax:syntaxTree()) -> non_neg_integer() | {non_neg_integer(), pos_integer()}.
-spec paths_match(string(), string()) -> boolean().