Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix formatting

  • Loading branch information...
commit 913bbffba78778cc418ce5bb02a5aaefe205824d 1 parent 10a13e3
@juranki authored
Showing with 15 additions and 11 deletions.
  1. +15 −11 src/rebar_config.erl
View
26 src/rebar_config.erl
@@ -61,9 +61,9 @@ new(ParentConfig) ->
Opts = case file:consult(ConfigFile) of
{ok, Terms} ->
%% Found a config file with some terms.
-
- %% Replace terms of form {test, ...} with values generated
- %% by functions in configure.erl
+
+ %% Replace terms of form {test, Fun, Args} with values
+ %% generated by functions in configure.erl
Terms2 = apply_configuration_tests(Terms),
%% We need to
@@ -138,12 +138,12 @@ apply_configuration_tests(Terms) ->
Tests ->
case cache_status() of
create ->
- ?CONSOLE("Creating configuration cache.~n", []),
ok = create_configuration_cache(Tests);
+ ?CONSOLE("Created configuration cache.~n", []),
update ->
- ?CONSOLE("Updating configuration cache.~n", []),
ok = file:delete("rebar.cache"),
ok = create_configuration_cache(Tests);
+ ?CONSOLE("Updated configuration cache.~n", []),
ok ->
ok
end,
@@ -182,13 +182,14 @@ create_configuration_cache(Tests) ->
case compile:file("configure", [binary, debug_info, report]) of
{ok, _, Bin} ->
{module, _} = code:load_binary(configure, "configure", Bin),
- Vals = [io_lib:format("~w.~n", [{{Test, Args},
- erlang:apply(configure, Test, Args)}])
+ Vals = [io_lib:format("~w.~n",
+ [{{Test, Args},
+ erlang:apply(configure, Test, Args)}])
|| {Test, Args} <- Tests],
ok = file:write_file("rebar.cache", Vals),
true = code:delete(configure),
ok;
- _ ->
+ _ ->
?ABORT("Failed to compile configuration tests.", [])
end.
@@ -206,13 +207,16 @@ replace_configuration_values([{test, Fun, Args} | Rest], ConfigTerms, Acc) ->
replace_configuration_values(Rest, ConfigTerms,
[proplists:get_value({Fun, Args}, ConfigTerms)
| Acc]);
-replace_configuration_values([Term | Rest], ConfigTerms, Acc) when is_list(Term) ->
+replace_configuration_values([Term | Rest], ConfigTerms, Acc)
+ when is_list(Term) ->
List = replace_configuration_values(Term, ConfigTerms, []),
replace_configuration_values(Rest, ConfigTerms,
[List | Acc]);
-replace_configuration_values([Term | Rest], ConfigTerms, Acc) when is_tuple(Term) ->
+replace_configuration_values([Term | Rest], ConfigTerms, Acc)
+ when is_tuple(Term) ->
Tuple = list_to_tuple(
- replace_configuration_values(tuple_to_list(Term), ConfigTerms, [])),
+ replace_configuration_values(tuple_to_list(Term),
+ ConfigTerms, [])),
replace_configuration_values(Rest, ConfigTerms, [Tuple | Acc]);
replace_configuration_values([Term | Rest], ConfigTerms, Acc) ->
replace_configuration_values(Rest, ConfigTerms, [Term | Acc]).
Please sign in to comment.
Something went wrong with that request. Please try again.