From 4314d778176225b6caecd354d6fddbdc5a1f7e17 Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Wed, 4 Jan 2017 19:21:33 +0000 Subject: Expose warnings as errors option Obtained from command line and saved in the state to be used on situations where we want to error out on warnings explicitly. --- src/rlx_state.erl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/rlx_state.erl') diff --git a/src/rlx_state.erl b/src/rlx_state.erl index 75a5cba..5032628 100644 --- a/src/rlx_state.erl +++ b/src/rlx_state.erl @@ -84,8 +84,9 @@ format/1, format/2, exclude_modules/1, - exclude_modules/2]). - + exclude_modules/2, + warnings_as_errors/1, + warnings_as_errors/2]). -export_type([t/0, releases/0, @@ -117,7 +118,8 @@ include_src=true :: boolean(), upfrom :: string() | binary() | undefined, config_values :: ec_dictionary:dictionary(Key::atom(), - Value::term())}). + Value::term()), + warnings_as_errors=false :: boolean()}). %%============================================================================ %% types @@ -454,6 +456,14 @@ hooks(_State=#state_t{providers=Providers}, Target) -> Provider = providers:get_provider(Target, Providers), providers:hooks(Provider). +-spec warnings_as_errors(t()) -> boolean(). +warnings_as_errors(#state_t{warnings_as_errors=WarningsAsErrors}) -> + WarningsAsErrors. + +-spec warnings_as_errors(t(), boolean()) -> t(). +warnings_as_errors(State, WarningsAsErrors) -> + State#state_t{warnings_as_errors=WarningsAsErrors}. + %% =================================================================== %% Internal functions %% =================================================================== -- cgit v1.2.3