Module elvis_file

Data Types

file()

file() = #{path => string(), content => binary(), term() => term()}

Function Index

filter_files/4Filter files based on the glob provided.
find_files/2Returns all files under the specified Path that match the pattern Name.
load_file_data/2Loads and adds all related file data.
module/1Return module name corresponding to a given .erl/.beam file.
parse_tree/2Add the root node of the parse tree to the file data.
parse_tree/3Add the root node of the parse tree to the file data, with filtering.
path/1Given a file() returns its path.
src/1Returns a tuple with the contents of the file and the file itself.

Function Details

filter_files/4

filter_files(Files::[file()], Dirs::[string()], Filter::string(), IgnoreList::[string()]) -> [file()]

Filter files based on the glob provided.

find_files/2

find_files(Dirs::[string()], Pattern::string()) -> [file()]

Returns all files under the specified Path that match the pattern Name.

load_file_data/2

load_file_data(Config::elvis_config:configs() | elvis_config:config(), File0::file()) -> file()

Loads and adds all related file data.

module/1

module(X1::file()) -> module()

Return module name corresponding to a given .erl/.beam file

parse_tree/2

parse_tree(Config::elvis_config:configs() | elvis_config:config(), Target::file()) -> {ktn_code:tree_node(), file()}

Add the root node of the parse tree to the file data.

parse_tree/3

parse_tree(Config::elvis_config:configs() | elvis_config:config(), File::file(), RuleConfig::elvis_core:rule_config()) -> {ktn_code:tree_node(), file()}

Add the root node of the parse tree to the file data, with filtering.

path/1

path(File::file()) -> string()

Given a file() returns its path.

src/1

src(File::file()) -> {binary(), file()} | {error, enoent}

Returns a tuple with the contents of the file and the file itself.


Generated by EDoc