Skip to content

Commit

Permalink
Fix dialyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
define-null committed Apr 23, 2019
1 parent 3f3a0fa commit cf688c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/elvis_core.erl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ do_parallel_rock(Config0) ->
[], [Config], Files, Parallel),
elvis_result_status(Results).

-spec do_rock(elvis_result:file(), elvis_config:config()) -> {ok, elvis_result:file()}.
-spec do_rock(elvis_file:file(), map() | [map()]) -> {ok, elvis_result:file()}.
do_rock(File, Config) ->
LoadedFile = load_file_data(Config, File),
Results = apply_rules(Config, LoadedFile),
Expand Down
7 changes: 4 additions & 3 deletions src/elvis_task.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Acc :: term()),
InitialAcc :: term(),
ExtraArgs :: list(),
JonItemList :: list(),
JoinItemList :: list(),
Concurrency :: non_neg_integer()) ->
{ok, FinalAcc :: term()} | {error, term()}.
chunk_fold({M,F} = FunWork, FunAcc, InitialAcc, ExtraArgs, List, ChunkSize)
Expand Down Expand Up @@ -53,6 +53,7 @@ start_worker(FunWork, ExtraArgs, Arg) ->
Key = spawn_monitor(fun() -> do_work(Parent, FunWork, ExtraArgs, Arg) end),
Key.

-spec do_work(pid(), {module(), atom()}, list(), term()) -> no_return().
do_work(Parent, {M,F}, ExtraArgs, Arg) ->
try erlang:apply(M, F, [Arg | ExtraArgs]) of
{ok, Results} ->
Expand Down Expand Up @@ -88,7 +89,7 @@ accumulate(AccF, AccR, Res, AccG) ->
{ok, AccR1} = AccF(Res, AccR),
AccR1
catch T:E ->
cleanup(AccG),
_ = cleanup(AccG),
throw({T,E})
end.

Expand All @@ -107,7 +108,7 @@ gather(Timeout, AccG) ->
{ok, Res0} ->
{AccG1, Res0};
{error, {T,E}} ->
cleanup(AccG1),
_ = cleanup(AccG1),
throw({T,E})
end
after Timeout ->
Expand Down
4 changes: 2 additions & 2 deletions test/elvis_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ chunk_fold(_Config) ->


-spec chunk_fold_task(integer(), integer()) -> {ok, integer()}.
chunk_fold_task(Elem, Miltiplier) ->
{ok, Elem * Miltiplier}.
chunk_fold_task(Elem, Multiplier) ->
{ok, Elem * Multiplier}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Private
Expand Down

0 comments on commit cf688c8

Please sign in to comment.