-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint the *.app and/or *.app.src files #980
Comments
What is the status of this issue? still relevant? still beginner friendly? |
Sounds to me like it should just be:
So yes :) |
IIRC: one thing I stumbled upon was: relx requires Also relx requires quite a bunch of keys which reltool didn’t care about. |
Yeah. IIRC those keys ended up being useful for relups whole reltool was glad to let this part of the procedure kind of die. For example, not including Can't remember the other ones off the top of my head, but those forced to be mandatory were usually there for a reason, and so early linting would probably be nice there yeah. |
This is sounding less beginner friendly. unless a try catch as suggested by @fenollp is enough |
I think the relevant code is in https://github.com/erlang/rebar3/blob/master/src/rebar_app_utils.erl#L97-L109 This function is called by the compiler task along with the discovery task, and basically ensures that the right fields are present (by default, it checks only for We could instead use that function and add warnings based on the content of these values: validate_application_info(AppInfo, AppDetail) ->
EbinDir = rebar_app_info:ebin_dir(AppInfo),
case rebar_app_info:app_file(AppInfo) of
undefined ->
false;
AppFile ->
lint_detail(AppDetail),
case proplists:get_value(modules, AppDetail) of
undefined ->
?PRV_ERROR({module_list, AppFile});
List ->
has_all_beams(EbinDir, List)
end
end.
lint_detail(AppDetail) ->
case proplists:get_value(description, AppDetail, "") of
"" -> ?WARN("~p is missing description entry", [AppFile]);
_ -> ok
end,
... % more checks and add all kinds of checks such as missing We should keep them warnings for now to prevent breaking builds that already worked. |
It would be nice if 'rebar compile" could check *.app and *.app.src files for problems which can cause a hickup later when generating a release. e.g.
All later required fields are present.
Bonus: they have the right format.
The text was updated successfully, but these errors were encountered: