From 1b87e8dc77149d24d15e25fcb8e2a45794b8cd05 Mon Sep 17 00:00:00 2001 From: Brujo Benavides Date: Mon, 6 Feb 2023 10:15:08 +0100 Subject: [PATCH] [RTI-13896] Add more dialyzer checks (#109) * [RTI-13896] Add more dialyzer checks * [RTI-13896] Remove old OTP versions from CI --- rebar.config | 2 +- src/mero_cluster_sup.erl | 3 ++- src/mero_conf_monitor.erl | 5 +++-- src/mero_sup.erl | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rebar.config b/rebar.config index 592fbff..0085d16 100644 --- a/rebar.config +++ b/rebar.config @@ -10,7 +10,7 @@ {deps, [{dynamic_compile, "1.0.0"}]}. {dialyzer, - [{warnings, [no_return, error_handling]}, + [{warnings, [no_return, error_handling, missing_return, extra_return]}, {plt_apps, top_level_deps}, {plt_extra_apps, [crypto, dynamic_compile]}, {plt_location, local}, diff --git a/src/mero_cluster_sup.erl b/src/mero_cluster_sup.erl index 1dc57ef..809277f 100644 --- a/src/mero_cluster_sup.erl +++ b/src/mero_cluster_sup.erl @@ -37,7 +37,8 @@ %%%=================================================================== %% @doc: Starts a list of workers with the provided configuration --spec start_link(ClusterName :: atom()) -> {ok, Pid :: pid()} | {error, Reason :: term()}. +-spec start_link(ClusterName :: atom()) -> + {ok, Pid :: pid()} | ignore | {error, Reason :: term()}. start_link(ClusterName) -> SupName = mero_cluster:sup_by_cluster_name(ClusterName), PoolDefs = mero_cluster:child_definitions(ClusterName), diff --git a/src/mero_conf_monitor.erl b/src/mero_conf_monitor.erl index 42bd359..c68875f 100644 --- a/src/mero_conf_monitor.erl +++ b/src/mero_conf_monitor.erl @@ -45,7 +45,7 @@ %%%----------------------------------------------------------------------------- %%% API %%%----------------------------------------------------------------------------- --spec start_link(cluster_config()) -> {ok, pid()} | {error, term()}. +-spec start_link(cluster_config()) -> {ok, pid()} | ignore | {error, term()}. start_link(OrigConfig) -> gen_server:start_link({local, ?MODULE}, ?MODULE, #{orig_config => OrigConfig}, []). @@ -81,7 +81,8 @@ handle_continue(program_heartbeat, State) -> program_heartbeat(), {noreply, State}. --spec handle_info(heartbeat | _, State) -> {noreply, State} when State :: state(). +-spec handle_info(heartbeat | _, state()) -> + {noreply, state()} | {noreply, state(), {continue, reload}}. handle_info(heartbeat, State) -> {noreply, State, {continue, reload}}; handle_info(_, State) -> diff --git a/src/mero_sup.erl b/src/mero_sup.erl index 549ed41..212ec18 100644 --- a/src/mero_sup.erl +++ b/src/mero_sup.erl @@ -43,7 +43,8 @@ %% @doc: Starts a list of workers with the configuration generated on %% mero_cluster --spec start_link(mero:cluster_config()) -> {ok, Pid :: pid()} | {error, Reason :: term()}. +-spec start_link(mero:cluster_config()) -> + {ok, Pid :: pid()} | ignore | {error, Reason :: term()}. start_link(OrigConfig) -> supervisor:start_link({local, ?MODULE}, ?MODULE, #{orig_config => OrigConfig}).