From 63b1798b1e7e10649d04cd04456cd8a1f39c6d78 Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Mon, 18 Mar 2024 00:49:53 +0100 Subject: [PATCH] OTP bump * sequel of 17e6f890783c18381fc39ad48779b3d09e7f0ffb * added R26 in CI/CD, and cleared out dialyzer warnings * from R26, by default, `-Wno_unknown` suppresses warnings [1] * in R25, it was the reverse behavior: `-Wunknown` allows warnings [2]. [1] https://www.erlang.org/doc/man/dialyzer.html#warning_options [2] https://www.erlang.org/docs/25/man/dialyzer#format_warning-1 --- .github/workflows/main.yml | 2 +- rebar.config.script | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2472afd..aba4921 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - otp_version: ['25.3', '25.2', '23.2'] + otp_version: ['26.2', '25.3', '25.2', '23.2'] os: [ubuntu-latest] steps: diff --git a/rebar.config.script b/rebar.config.script index 9c1ed91..0f7c22b 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -10,8 +10,15 @@ Rebar2Deps = [ {cf, ".*", {git, "https://github.com/project-fifo/cf", {tag, "0.2.2"}}} ], +NoDialWarns = {dialyzer, [{warnings, [no_unknown]}]}, +OTPRelease = erlang:list_to_integer(erlang:system_info(otp_release)), +WarnsRemoved = case OTPRelease<26 of + true -> fun(Config) -> Config end; + false -> fun(Config) -> lists:keystore(dialyzer, 1, Config, NoDialWarns) end + end, + case IsRebar3 of - true -> CONFIG; + true -> WarnsRemoved(CONFIG); false -> - lists:keyreplace(deps, 1, CONFIG, {deps, Rebar2Deps}) + lists:keyreplace(deps, 1, WarnsRemoved(CONFIG), {deps, Rebar2Deps}) end.