diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2015-04-02 16:10:31 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2015-04-02 16:10:31 +0200 |
commit | 6127f528b994c69e70ef3d7654ef3d5d7a850a09 (patch) | |
tree | 1a40f329acda71da0545eab69622ddbc9462bc0c | |
parent | 65b0f917b80db0be9b5c75d3b041369f459a24b8 (diff) | |
download | rebar-6127f528b994c69e70ef3d7654ef3d5d7a850a09.tar.gz |
Fix whitespace errors
-rw-r--r-- | inttest/cover/cover_rt.erl | 12 | ||||
-rw-r--r-- | src/rebar_cover_utils.erl | 8 | ||||
-rw-r--r-- | src/rebar_ct.erl | 31 | ||||
-rw-r--r-- | src/rebar_otp_appup.erl | 7 | ||||
-rw-r--r-- | src/rebar_reltool.erl | 6 |
5 files changed, 36 insertions, 28 deletions
diff --git a/inttest/cover/cover_rt.erl b/inttest/cover/cover_rt.erl index 34d65c5..a9f3f08 100644 --- a/inttest/cover/cover_rt.erl +++ b/inttest/cover/cover_rt.erl @@ -47,25 +47,25 @@ ifdef_test() -> {ok, Output} = retest:sh("./rebar -v eunit"), io:format("output => ~p~n", [Output]), ?assert(check_output(Output, "foo")), - {ok,Listing} = file:list_dir(".eunit"), + {ok, Listing} = file:list_dir(".eunit"), ?assert(check_output(Listing, "foo.beam")), ?assertMatch({ok,_}, retest:sh("./rebar clean")). cover_export_json_test() -> - {ok,Output} = - retest:sh("./rebar -v -C rebar-cover_export_json.config eunit"), + {ok, Output} = + retest:sh("./rebar -v -C rebar-cover_export_json.config eunit"), ?assert(check_output(Output, "foo")), ?assertEqual( {ok, <<"{\"module\":\"foo\",\"covered\":2,\"not_covered\":1}">>}, file:read_file(".eunit/foo.COVER.json")), ?assertMatch( - {ok,_}, + {ok, _}, retest:sh("./rebar -C rebar-cover_export_json.config clean")). check_output(Output,Target) -> lists:any(fun(Line) -> - string:str(Line, Target) > 0 - end, Output). + string:str(Line, Target) > 0 + end, Output). app(Name) -> App = {application, Name, [{description, atom_to_list(Name)}, diff --git a/src/rebar_cover_utils.erl b/src/rebar_cover_utils.erl index a7514da..3fcba63 100644 --- a/src/rebar_cover_utils.erl +++ b/src/rebar_cover_utils.erl @@ -54,7 +54,7 @@ close(F) -> ok = file:close(F). exit() -> - cover:stop(). + cover:stop(). init(false, _BeamFiles, _TargetDir) -> {ok, not_enabled}; @@ -139,7 +139,7 @@ analyze(Config, FilteredModules, SrcModules, TargetDir) -> false -> ok end, - + %% Generate JSON Coverage Data, if configured case rebar_config:get(Config, cover_export_json, false) of true -> @@ -260,12 +260,12 @@ export_json_coverage(TargetDir,Coverage) -> end, Coverage). export_json_coverage_to_file(TargetDir, {Module, Covered, NotCovered}) -> - {ok,JsonFile} = file:open(json_file(TargetDir, Module), [write]), + {ok, JsonFile} = file:open(json_file(TargetDir, Module), [write]), io:format(JsonFile, "{\"module\":~p,\"covered\":~p,\"not_covered\":~p}", [atom_to_list(Module), Covered, NotCovered]), ok = file:close(JsonFile). - + json_file(TargetDir, Module) -> filename:join([TargetDir, atom_to_list(Module) ++ ".COVER.json"]). diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl index 152e28f..c44fa63 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -295,18 +295,23 @@ collect_glob(Config, Cwd, Glob) -> {true, Deps} = rebar_deps:get_deps_dir(Config), DepsDir = filename:basename(Deps), CwdParts = filename:split(Cwd), - filelib:fold_files(Cwd, Glob, true, fun(F, Acc) -> - %% Ignore any specs under the deps/ directory. Do this pulling - %% the dirname off the F and then splitting it into a list. - Parts = filename:split(filename:dirname(F)), - Parts2 = remove_common_prefix(Parts, CwdParts), - case lists:member(DepsDir, Parts2) of - true -> - Acc; % There is a directory named "deps" in path - false -> - [F | Acc] % No "deps" directory in path - end - end, []). + filelib:fold_files( + Cwd, + Glob, + true, + fun(F, Acc) -> + %% Ignore any specs under the deps/ directory. Do this pulling + %% the dirname off the F and then splitting it into a list. + Parts = filename:split(filename:dirname(F)), + Parts2 = remove_common_prefix(Parts, CwdParts), + case lists:member(DepsDir, Parts2) of + true -> + %% There is a directory named "deps" in path + Acc; + false -> + [F | Acc] % No "deps" directory in path + end + end, []). remove_common_prefix([H1|T1], [H1|T2]) -> remove_common_prefix(T1, T2); @@ -344,7 +349,7 @@ get_suites(Config, TestDir) -> get_suites(Config) -> case rebar_config:get_global(Config, suites, undefined) of undefined -> - rebar_config:get_global(Config, suite, undefined); + rebar_config:get_global(Config, suite, undefined); Suites -> Suites end. diff --git a/src/rebar_otp_appup.erl b/src/rebar_otp_appup.erl index 5baaf33..a453c13 100644 --- a/src/rebar_otp_appup.erl +++ b/src/rebar_otp_appup.erl @@ -74,11 +74,12 @@ preprocess(SourceFile, TargetFile, _Config) -> %% http://erlang.org/doc/man/appup.html. {ok, [{_Vsn, UpFromVsn, DownToVsn} = AppUp]} when is_list(UpFromVsn), is_list(DownToVsn) -> - case file:write_file(TargetFile, - lists:flatten(io_lib:format("~p.", [AppUp]))) of + case file:write_file( + TargetFile, + lists:flatten(io_lib:format("~p.", [AppUp]))) of {error, Reason} -> ?ABORT("Failed writing to target file ~s due to ~s", - [TargetFile, Reason]); + [TargetFile, Reason]); ok -> ok end; {error, Reason} -> diff --git a/src/rebar_reltool.erl b/src/rebar_reltool.erl index 0e46f84..5366026 100644 --- a/src/rebar_reltool.erl +++ b/src/rebar_reltool.erl @@ -196,7 +196,8 @@ process_overlay(Config, ReltoolConfig) -> %% providing an additional file on the command-line. %% overlay_vars(Config, Vars0, ReltoolConfig) -> - BaseVars = load_vars_file([proplists:get_value(overlay_vars, ReltoolConfig)]), + BaseVars = load_vars_file( + [proplists:get_value(overlay_vars, ReltoolConfig)]), OverlayVars = rebar_config:get_global(Config, overlay_vars, []), OverrideVars = load_vars_file(string:tokens(OverlayVars, ",")), M = fun merge_overlay_var/3, @@ -327,7 +328,8 @@ overlay_files(ReltoolConfig) -> {overlay, Overlay} when is_list(Overlay) -> Overlay; false -> - ?INFO("No {overlay, [...]} found in reltool.config.\n", []), + ?INFO("No {overlay, [...]} found in reltool.config.\n", + []), []; _ -> ?ABORT("{overlay, [...]} entry in reltool.config " |