summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2009-12-14 08:58:22 -0500
committerDave Smith <dizzyd@dizzyd.com>2009-12-14 08:58:22 -0500
commitd6600ab506276f3a5aa65b0aaafc62bc7826c213 (patch)
treeafc2a24743a7d5383be752e55a4b2eb0b346592a /src
parent2b7971cc6bb672422c4c9681f4192dd554443014 (diff)
Fixing number of warnings and buglets
Diffstat (limited to 'src')
-rw-r--r--src/rebar_core.erl9
-rw-r--r--src/rebar_ct.erl2
-rw-r--r--src/rebar_erlc_compiler.erl2
-rw-r--r--src/rebar_eunit.erl12
-rw-r--r--src/rebar_file_utils.erl2
-rw-r--r--src/rebar_otp_app.erl2
-rw-r--r--src/rebar_port_compiler.erl2
7 files changed, 13 insertions, 18 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 373a7e8..c5a3dc6 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -48,11 +48,6 @@ run(Args) ->
%% 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.
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
ok = application:load(rebar),
@@ -160,7 +155,7 @@ rel_dir(Dir) ->
-apply_commands([], Modules, Config, ModuleFile) ->
+apply_commands([], _Modules, _Config, _ModuleFile) ->
ok;
apply_commands([Command | Rest], Modules, Config, ModuleFile) ->
case select_modules(Modules, Command, []) of
@@ -207,7 +202,7 @@ expand_lib_dirs([], _Root, Acc) ->
expand_lib_dirs([Dir | Rest], Root, Acc) ->
Apps = filelib:wildcard(filename:join([Dir, '*', ebin])),
FqApps = [filename:join([Root, A]) || A <- Apps],
- expand_lib_dirs(Rest, Root, Apps ++ FqApps).
+ expand_lib_dirs(Rest, Root, Acc ++ FqApps).
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index 007e09f..b4f3612 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -131,7 +131,7 @@ show_log(RawLog) ->
ok
end.
-make_cmd(TestDir, Config) ->
+make_cmd(TestDir, _Config) ->
{ok, Cwd} = file:get_cwd(),
LogDir = filename:join(Cwd, "logs"),
Ebin = filename:join(Cwd, "ebin"),
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 7a969f7..12e20e9 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -151,7 +151,7 @@ compile_queue(Pids, Targets, Config, CompileFn) ->
Pids2 = lists:delete({Pid, Mref}, Pids),
compile_queue(Pids2, Targets, Config, CompileFn);
- {'DOWN', Mref, _, Pid, Info} ->
+ {'DOWN', _Mref, _, _Pid, Info} ->
?DEBUG("Worker failed: ~p\n", [Info]),
?FAIL
end.
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index a75a8a0..e82bd38 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -45,7 +45,7 @@
%% Public API
%% ===================================================================
-eunit(Config, File) ->
+eunit(Config, _File) ->
%% Make sure ?EUNIT_DIR/ directory exists (tack on dummy module)
ok = filelib:ensure_dir(?EUNIT_DIR ++ "/foo"),
@@ -105,7 +105,7 @@ eunit(Config, File) ->
true = code:set_path(InitCodePath),
ok.
-clean(Config, File) ->
+clean(_Config, _File) ->
rebar_file_utils:rm_rf(?EUNIT_DIR).
@@ -148,7 +148,7 @@ is_quickcheck_avail() ->
IsAvail
end.
-cover_init(Config) ->
+cover_init(_Config) ->
%% Make sure any previous runs of cover don't unduly influence
cover:reset(),
@@ -175,9 +175,9 @@ cover_init(Config) ->
end
end.
-cover_analyze(Config, []) ->
+cover_analyze(_Config, []) ->
ok;
-cover_analyze(Config, Modules) ->
+cover_analyze(_Config, Modules) ->
%% Generate coverage info for all the cover-compiled modules
Coverage = [cover_analyze_mod(M) || M <- Modules],
@@ -203,7 +203,7 @@ cover_analyze_mod(Module) ->
cover_write_index(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}
end, {0, 0}, Coverage),
TotalCoverage = percentage(Covered, NotCovered),
diff --git a/src/rebar_file_utils.erl b/src/rebar_file_utils.erl
index 8d21323..8cae1ee 100644
--- a/src/rebar_file_utils.erl
+++ b/src/rebar_file_utils.erl
@@ -56,7 +56,7 @@ ln_sf(Source, Dest) ->
false ->
ActualDest = Dest
end,
- [] = os:cmd(?FMT("ln -sf ~s ~s", [Source, Dest])),
+ [] = os:cmd(?FMT("ln -sf ~s ~s", [Source, ActualDest])),
ok.
delete_each([]) ->
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl
index 07e6457..7a9a135 100644
--- a/src/rebar_otp_app.erl
+++ b/src/rebar_otp_app.erl
@@ -33,7 +33,7 @@
%% Public API
%% ===================================================================
-compile(Config, File) ->
+compile(_Config, File) ->
%% Load the app name and version from the .app file and construct
%% the app identifier
{ok, AppName, AppData} = rebar_app_utils:load_app_file(File),
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index c99cf04..a11fa19 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -150,7 +150,7 @@ run_cleanup_hook(Config) ->
end.
-compile_each([], Config, Env, NewBins, ExistingBins) ->
+compile_each([], _Config, _Env, NewBins, ExistingBins) ->
{lists:reverse(NewBins), lists:reverse(ExistingBins)};
compile_each([Source | Rest], Config, Env, NewBins, ExistingBins) ->
Ext = filename:extension(Source),