Module hank_rule

Behavior for defining a rule for Hank.

This module defines the hank_rule behaviour.
Required callback functions: analyze/2, ignored/2.

Description

Behavior for defining a rule for Hank.

Data Types

asts()

asts() = [{file:filename(), erl_syntax:forms()}]

ignore_pattern()

ignore_pattern() = undefined | tuple()

ignore_spec()

ignore_spec() = {file:filename(), t() | all} | {file:filename(), t(), term()}

result()

result() = #{file := file:filename(), line := non_neg_integer(), text := iodata(), rule => t(), pattern => ignore_pattern()}

t()

t() = module()

Function Index

analyze/3Analyze the given files with the rule.
default_rules/0The list of default rules to apply.
is_ignored/3Check if given rule should be ignored from results.

Function Details

analyze/3

analyze(Rule::t(), ASTs::asts(), Context::hank_context:t()) -> [result()]

Analyze the given files with the rule.

default_rules/0

default_rules() -> []

The list of default rules to apply

is_ignored/3

is_ignored(Rule::t(), Pattern::ignore_pattern(), IgnoredSpecs::[all | term()]) -> boolean()

Check if given rule should be ignored from results


Generated by EDoc