diff --git a/src/elvis_core.erl b/src/elvis_core.erl index 85da8ccf..6a0e76ab 100644 --- a/src/elvis_core.erl +++ b/src/elvis_core.erl @@ -57,7 +57,7 @@ rock_this(Path, Config) -> NewConfig = elvis_config:normalize(Config), Dirname = filename:dirname(Path), Filename = filename:basename(Path), - File = case elvis_file:find_files([Dirname], Filename, local) of + File = case elvis_file:find_files([Dirname], Filename) of [] -> throw({enoent, Path}); [File0] -> File0 end, diff --git a/src/elvis_file.erl b/src/elvis_file.erl index 1b64c173..5dff3cd4 100644 --- a/src/elvis_file.erl +++ b/src/elvis_file.erl @@ -7,7 +7,6 @@ load_file_data/2, find_files/2, - find_files/3, filter_files/4 ]). @@ -67,16 +66,8 @@ load_file_data(Config, File0 = #{path := _Path}) -> %% that match the pattern Name. -spec find_files([string()], string()) -> [file()]. find_files(Dirs, Pattern) -> - find_files(Dirs, Pattern, recursive). - --spec find_files([string()], string(), recursive | local) -> [file()]. -find_files(Dirs, Pattern, Option) -> - MiddlePath = case Option of - recursive -> "/**/"; - local -> "/" - end, Fun = fun(Dir) -> - filelib:wildcard(Dir ++ MiddlePath ++ Pattern) + filelib:wildcard(filename:join(Dir, Pattern)) end, [#{path => Path} || Path <- lists:flatmap(Fun, Dirs)].