Browse Source

Merge pull request #2100 from ferd/lint-on-compile

Only lint app files when compiling
pull/2010/head
Fred Hebert 5 years ago
committed by GitHub
parent
commit
dec3aeb6c5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions
  1. +6
    -1
      src/rebar_app_utils.erl
  2. +1
    -0
      src/rebar_prv_compile.erl
  3. +0
    -1
      test/rebar_compile_SUITE.erl

+ 6
- 1
src/rebar_app_utils.erl View File

@ -37,6 +37,7 @@
parse_dep/6, parse_dep/6,
expand_deps_sources/2, expand_deps_sources/2,
dep_to_app/7, dep_to_app/7,
lint_app_info/1,
format_error/1]). format_error/1]).
-include("rebar.hrl"). -include("rebar.hrl").
@ -101,7 +102,6 @@ validate_application_info(AppInfo, AppDetail) ->
undefined -> undefined ->
false; false;
AppFile -> AppFile ->
lint_detail(AppDetail, AppFile),
case proplists:get_value(modules, AppDetail) of case proplists:get_value(modules, AppDetail) of
undefined -> undefined ->
?PRV_ERROR({module_list, AppFile}); ?PRV_ERROR({module_list, AppFile});
@ -110,6 +110,11 @@ validate_application_info(AppInfo, AppDetail) ->
end end
end. end.
lint_app_info(AppInfo) ->
AppDetails = rebar_app_info:app_details(AppInfo),
AppFile = rebar_app_info:app_file(AppInfo),
lint_detail(AppDetails, AppFile).
-spec lint_detail(list(), file:filename_all()) -> ok. -spec lint_detail(list(), file:filename_all()) -> ok.
lint_detail(AppDetail, AppFile) -> lint_detail(AppDetail, AppFile) ->
lint_description(AppDetail, AppFile), lint_description(AppDetail, AppFile),

+ 1
- 0
src/rebar_prv_compile.erl View File

@ -247,6 +247,7 @@ has_all_artifacts(AppInfo1) ->
{false, File} -> {false, File} ->
throw(?PRV_ERROR({missing_artifact, File})); throw(?PRV_ERROR({missing_artifact, File}));
true -> true ->
rebar_app_utils:lint_app_info(AppInfo1),
true true
end. end.

+ 0
- 1
test/rebar_compile_SUITE.erl View File

@ -41,7 +41,6 @@ all() ->
dont_recompile_when_erl_compiler_options_env_does_not_change, dont_recompile_when_erl_compiler_options_env_does_not_change,
recompile_when_erl_compiler_options_env_changes, recompile_when_erl_compiler_options_env_changes,
rebar_config_os_var, rebar_config_os_var,
app_file_linting]. app_file_linting].
groups() -> groups() ->

Loading…
Cancel
Save