elvis_config (elvis_core v4.2.0)

View Source

Summary

Functions

Takes a function and configuration and applies the function to all file in the configuration.

Merge user rules (override) with elvis default rules.

Takes a configuration and finds all files according to its 'dirs' end 'filter' key, or if not specified uses '*.erl'.

Takes a configuration and a list of files, filtering some of them according to the 'filter' key, or if not specified uses '*.erl'.

Types

fail_validation/0

-type fail_validation() :: {fail, [{throw, {invalid_config, Message :: string()}}]}.

output_format/0

-type output_format() :: plain | colors | parsable.

t/0

-opaque t()

Functions

apply_to_files(Fun, Config)

-spec apply_to_files(Fun :: fun(), Config :: [t()] | t()) -> [t()] | t().

Takes a function and configuration and applies the function to all file in the configuration.

config()

-spec config() -> [t()] | fail_validation().

default()

-spec default() -> [t()].

dirs(Config)

-spec dirs(Config :: [t()] | t()) -> [string()].

files(RuleGroup)

-spec files(RuleGroup :: [t()] | t()) -> [elvis_file:t()].

filter(Config)

-spec filter([t()] | t()) -> [string()].

from_file(File)

-spec from_file(File :: string()) -> [t()] | fail_validation().

from_rebar(File)

-spec from_rebar(File :: string()) -> [t()] | fail_validation().

ignore(Config)

-spec ignore([t()] | t()) -> [string()].

merge_rules(UserRules, DefaultRules)

-spec merge_rules(UserRules :: list(), DefaultRules :: list()) -> [elvis_rule:t()].

Merge user rules (override) with elvis default rules.

no_output()

-spec no_output() -> boolean().

output_format()

-spec output_format() -> output_format().

parallel()

-spec parallel() -> pos_integer().

resolve_files(RuleGroup)

-spec resolve_files(t()) -> t().

Takes a configuration and finds all files according to its 'dirs' end 'filter' key, or if not specified uses '*.erl'.

resolve_files(Config, Files)

-spec resolve_files(Config :: [t()] | t(), Files :: [elvis_file:t()]) -> [t()] | t().

Takes a configuration and a list of files, filtering some of them according to the 'filter' key, or if not specified uses '*.erl'.

rules(RulesL)

-spec rules(RulesL :: [t()]) -> [[elvis_rule:t()]];
           (Rules :: t()) -> [elvis_rule:t()].

ruleset(ElvisConfig)

-spec ruleset(t()) -> Ruleset :: atom() | undefined.

set_no_output(NoOutput)

-spec set_no_output(boolean()) -> ok.

set_output_format(OutputFormat)

-spec set_output_format(output_format()) -> ok.

set_parallel(Parallel)

-spec set_parallel(pos_integer()) -> ok.

set_verbose(Verbose)

-spec set_verbose(boolean()) -> ok.

validate_config(ElvisConfig)

-spec validate_config(term()) -> ok.

verbose()

-spec verbose() -> boolean().