View Source elvis_config (elvis_core v3.2.5)

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

-type config() :: map().
-type configs() :: [config()].

Functions

Link to this function

apply_to_files(Fun, Config)

View Source
-spec apply_to_files(Fun :: fun(), Config :: configs() | config()) -> configs() | config().

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

-spec dirs(Config :: configs() | config()) -> [string()].
-spec files(RuleGroup :: configs() | config()) -> [elvis_file:file()].
-spec filter(configs() | config()) -> [string()].
Link to this function

from_application_or_config(Key, Default)

View Source
-spec from_application_or_config(atom(), term()) -> term().
-spec from_file(string()) -> configs().
-spec from_rebar(string()) -> configs().
-spec ignore(configs() | config()) -> [string()].
Link to this function

merge_rules(UserRules, DefaultRules)

View Source
-spec merge_rules(UserRules :: list(), DefaultRules :: list()) -> [elvis_core:rule()].

Merge user rules (override) with elvis default rules.

-spec normalize(configs()) -> configs().
Link to this function

resolve_files(RuleGroup)

View Source
-spec resolve_files(config()) -> config().

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

Link to this function

resolve_files(Config, Files)

View Source
-spec resolve_files(Config :: configs() | config(), Files :: [elvis_file:file()]) ->
                       configs() | config().

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

-spec rules(RulesL :: configs()) -> [[elvis_core:rule()]];
           (Rules :: config()) -> [elvis_core:rule()].
-spec validate(Config :: configs()) -> ok.