From e037ec8c8f805ab73f551bd061903539f70e50b8 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 23 Sep 2020 11:55:43 +0000 Subject: [PATCH 1/2] Ignore `global` in empty profiles warning for `as` --- src/rebar_prv_as.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rebar_prv_as.erl b/src/rebar_prv_as.erl index 562ce99b3..2d9887a16 100644 --- a/src/rebar_prv_as.erl +++ b/src/rebar_prv_as.erl @@ -101,5 +101,7 @@ warn_on_empty_profile(Profiles, State) -> ProjectApps = rebar_state:project_apps(State), DefinedProfiles = rebar_state:get(State, profiles, []) ++ lists:flatten([rebar_app_info:get(AppInfo, profiles, []) || AppInfo <- ProjectApps]), - [?WARN("No entry for profile ~ts in config.", [Profile]) || - Profile <- Profiles, not(lists:keymember(list_to_atom(Profile), 1, DefinedProfiles))]. + [?WARN("No entry for profile ~ts in config.", [Profile]) + || Profile <- Profiles, + not lists:keymember(list_to_atom(Profile), 1, DefinedProfiles), + Profile =/= "global"]. From 7eb983b822c70d9713292f50e74251fec2cb9406 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 23 Sep 2020 12:13:13 +0000 Subject: [PATCH 2/2] also ignore 'default' for profile warnings --- src/rebar_prv_as.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_as.erl b/src/rebar_prv_as.erl index 2d9887a16..f560113be 100644 --- a/src/rebar_prv_as.erl +++ b/src/rebar_prv_as.erl @@ -104,4 +104,5 @@ warn_on_empty_profile(Profiles, State) -> [?WARN("No entry for profile ~ts in config.", [Profile]) || Profile <- Profiles, not lists:keymember(list_to_atom(Profile), 1, DefinedProfiles), - Profile =/= "global"]. + Profile =/= "global", Profile =/= "default"], + ok.