mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Fixing number of warnings and buglets
This commit is contained in:
parent
2b7971cc6b
commit
d6600ab506
7 changed files with 13 additions and 18 deletions
|
@ -48,11 +48,6 @@ run(Args) ->
|
||||||
%% Filter all the flags (i.e. string of form key=value) from the
|
%% Filter all the flags (i.e. string of form key=value) from the
|
||||||
%% command line arguments. What's left will be the commands to run.
|
%% command line arguments. What's left will be the commands to run.
|
||||||
Commands = filter_flags(Args, []),
|
Commands = filter_flags(Args, []),
|
||||||
|
|
||||||
% dbg:tracer(),
|
|
||||||
dbg:p(all, call),
|
|
||||||
dbg:tpl(rebar_core, []),
|
|
||||||
dbg:tpl(rebar_erlc_compiler, clean, []),
|
|
||||||
|
|
||||||
%% Pre-load the rebar app so that we get default configuration
|
%% Pre-load the rebar app so that we get default configuration
|
||||||
ok = application:load(rebar),
|
ok = application:load(rebar),
|
||||||
|
@ -160,7 +155,7 @@ rel_dir(Dir) ->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apply_commands([], Modules, Config, ModuleFile) ->
|
apply_commands([], _Modules, _Config, _ModuleFile) ->
|
||||||
ok;
|
ok;
|
||||||
apply_commands([Command | Rest], Modules, Config, ModuleFile) ->
|
apply_commands([Command | Rest], Modules, Config, ModuleFile) ->
|
||||||
case select_modules(Modules, Command, []) of
|
case select_modules(Modules, Command, []) of
|
||||||
|
@ -207,7 +202,7 @@ expand_lib_dirs([], _Root, Acc) ->
|
||||||
expand_lib_dirs([Dir | Rest], Root, Acc) ->
|
expand_lib_dirs([Dir | Rest], Root, Acc) ->
|
||||||
Apps = filelib:wildcard(filename:join([Dir, '*', ebin])),
|
Apps = filelib:wildcard(filename:join([Dir, '*', ebin])),
|
||||||
FqApps = [filename:join([Root, A]) || A <- Apps],
|
FqApps = [filename:join([Root, A]) || A <- Apps],
|
||||||
expand_lib_dirs(Rest, Root, Apps ++ FqApps).
|
expand_lib_dirs(Rest, Root, Acc ++ FqApps).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ show_log(RawLog) ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
make_cmd(TestDir, Config) ->
|
make_cmd(TestDir, _Config) ->
|
||||||
{ok, Cwd} = file:get_cwd(),
|
{ok, Cwd} = file:get_cwd(),
|
||||||
LogDir = filename:join(Cwd, "logs"),
|
LogDir = filename:join(Cwd, "logs"),
|
||||||
Ebin = filename:join(Cwd, "ebin"),
|
Ebin = filename:join(Cwd, "ebin"),
|
||||||
|
|
|
@ -151,7 +151,7 @@ compile_queue(Pids, Targets, Config, CompileFn) ->
|
||||||
Pids2 = lists:delete({Pid, Mref}, Pids),
|
Pids2 = lists:delete({Pid, Mref}, Pids),
|
||||||
compile_queue(Pids2, Targets, Config, CompileFn);
|
compile_queue(Pids2, Targets, Config, CompileFn);
|
||||||
|
|
||||||
{'DOWN', Mref, _, Pid, Info} ->
|
{'DOWN', _Mref, _, _Pid, Info} ->
|
||||||
?DEBUG("Worker failed: ~p\n", [Info]),
|
?DEBUG("Worker failed: ~p\n", [Info]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
%% Public API
|
%% Public API
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
|
|
||||||
eunit(Config, File) ->
|
eunit(Config, _File) ->
|
||||||
%% Make sure ?EUNIT_DIR/ directory exists (tack on dummy module)
|
%% Make sure ?EUNIT_DIR/ directory exists (tack on dummy module)
|
||||||
ok = filelib:ensure_dir(?EUNIT_DIR ++ "/foo"),
|
ok = filelib:ensure_dir(?EUNIT_DIR ++ "/foo"),
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ eunit(Config, File) ->
|
||||||
true = code:set_path(InitCodePath),
|
true = code:set_path(InitCodePath),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
clean(Config, File) ->
|
clean(_Config, _File) ->
|
||||||
rebar_file_utils:rm_rf(?EUNIT_DIR).
|
rebar_file_utils:rm_rf(?EUNIT_DIR).
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ is_quickcheck_avail() ->
|
||||||
IsAvail
|
IsAvail
|
||||||
end.
|
end.
|
||||||
|
|
||||||
cover_init(Config) ->
|
cover_init(_Config) ->
|
||||||
%% Make sure any previous runs of cover don't unduly influence
|
%% Make sure any previous runs of cover don't unduly influence
|
||||||
cover:reset(),
|
cover:reset(),
|
||||||
|
|
||||||
|
@ -175,9 +175,9 @@ cover_init(Config) ->
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
cover_analyze(Config, []) ->
|
cover_analyze(_Config, []) ->
|
||||||
ok;
|
ok;
|
||||||
cover_analyze(Config, Modules) ->
|
cover_analyze(_Config, Modules) ->
|
||||||
%% Generate coverage info for all the cover-compiled modules
|
%% Generate coverage info for all the cover-compiled modules
|
||||||
Coverage = [cover_analyze_mod(M) || M <- Modules],
|
Coverage = [cover_analyze_mod(M) || M <- Modules],
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ cover_analyze_mod(Module) ->
|
||||||
|
|
||||||
cover_write_index(Coverage) ->
|
cover_write_index(Coverage) ->
|
||||||
%% Calculate total coverage %
|
%% Calculate total coverage %
|
||||||
{Covered, NotCovered} = lists:foldl(fun({Mod, C, N}, {CAcc, NAcc}) ->
|
{Covered, NotCovered} = lists:foldl(fun({_Mod, C, N}, {CAcc, NAcc}) ->
|
||||||
{CAcc + C, NAcc + N}
|
{CAcc + C, NAcc + N}
|
||||||
end, {0, 0}, Coverage),
|
end, {0, 0}, Coverage),
|
||||||
TotalCoverage = percentage(Covered, NotCovered),
|
TotalCoverage = percentage(Covered, NotCovered),
|
||||||
|
|
|
@ -56,7 +56,7 @@ ln_sf(Source, Dest) ->
|
||||||
false ->
|
false ->
|
||||||
ActualDest = Dest
|
ActualDest = Dest
|
||||||
end,
|
end,
|
||||||
[] = os:cmd(?FMT("ln -sf ~s ~s", [Source, Dest])),
|
[] = os:cmd(?FMT("ln -sf ~s ~s", [Source, ActualDest])),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
delete_each([]) ->
|
delete_each([]) ->
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
%% Public API
|
%% Public API
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
|
|
||||||
compile(Config, File) ->
|
compile(_Config, File) ->
|
||||||
%% Load the app name and version from the .app file and construct
|
%% Load the app name and version from the .app file and construct
|
||||||
%% the app identifier
|
%% the app identifier
|
||||||
{ok, AppName, AppData} = rebar_app_utils:load_app_file(File),
|
{ok, AppName, AppData} = rebar_app_utils:load_app_file(File),
|
||||||
|
|
|
@ -150,7 +150,7 @@ run_cleanup_hook(Config) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
compile_each([], Config, Env, NewBins, ExistingBins) ->
|
compile_each([], _Config, _Env, NewBins, ExistingBins) ->
|
||||||
{lists:reverse(NewBins), lists:reverse(ExistingBins)};
|
{lists:reverse(NewBins), lists:reverse(ExistingBins)};
|
||||||
compile_each([Source | Rest], Config, Env, NewBins, ExistingBins) ->
|
compile_each([Source | Rest], Config, Env, NewBins, ExistingBins) ->
|
||||||
Ext = filename:extension(Source),
|
Ext = filename:extension(Source),
|
||||||
|
|
Loading…
Reference in a new issue