From 54e0714aebc0edf4a7a64a6cea85307921a9b10f Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Tue, 21 May 2024 19:54:34 +0100 Subject: [PATCH 1/5] Test over OTP 27 and rebar3 3.23 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a89e259f..a886d344 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,8 @@ jobs: runs-on: ${{matrix.os}} strategy: matrix: - otp_vsn: ['24', '25', '26'] - rebar3_vsn: ['3.22'] + otp_vsn: ['24', '25', '26', '27'] + rebar3_vsn: ['3.23'] os: [ubuntu-22.04, windows-2022] steps: - uses: actions/checkout@v3 From df84309ab78234c883359f15b7115843d6d56a1d Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Tue, 21 May 2024 21:35:33 +0100 Subject: [PATCH 2/5] Avoid test compilation issues on OTP 27 --- test/examples/fail_no_successive_maps.erl | 10 ++++++++++ test/examples/pass_no_successive_maps_elvis_attr.erl | 10 ++++++++++ test/style_SUITE.erl | 9 +++++++++ 3 files changed, 29 insertions(+) diff --git a/test/examples/fail_no_successive_maps.erl b/test/examples/fail_no_successive_maps.erl index 2e858200..5c0f32cd 100644 --- a/test/examples/fail_no_successive_maps.erl +++ b/test/examples/fail_no_successive_maps.erl @@ -2,12 +2,22 @@ -export([bad/0, good/0]). +-if(?OTP_RELEASE<27). bad() -> M = #{this => is}#{wrong => "and"}, M2 = M#{this := is}#{wrong := "as well"}, M2#{this := is}#{also => wrong}. +-else. +bad() -> + #{}. +-endif. +-if(?OTP_RELEASE<27). good() -> M = #{this => is, good => "and"}, M2 = M#{this := is, good := #{as => well}}, M2#{this := is, also => good}. +-else. +good() -> + #{}. +-endif. diff --git a/test/examples/pass_no_successive_maps_elvis_attr.erl b/test/examples/pass_no_successive_maps_elvis_attr.erl index a0f6b88c..a43719a9 100644 --- a/test/examples/pass_no_successive_maps_elvis_attr.erl +++ b/test/examples/pass_no_successive_maps_elvis_attr.erl @@ -4,12 +4,22 @@ -elvis([{elvis_style, no_successive_maps, disable}]). +-if(?OTP_RELEASE<27). bad() -> M = #{this => is}#{wrong => "and"}, M2 = M#{this := is}#{wrong := "as well"}, M2#{this := is}#{also => wrong}. +-else. +bad() -> + #{}. +-endif. +-if(?OTP_RELEASE<27). good() -> M = #{this => is, good => "and"}, M2 = M#{this := is, good := "as well"}, M2#{this := is, also => good}. +-else. +good() -> + #{}. +-endif. diff --git a/test/style_SUITE.erl b/test/style_SUITE.erl index 8d5148e5..e04cb71f 100644 --- a/test/style_SUITE.erl +++ b/test/style_SUITE.erl @@ -1238,6 +1238,8 @@ verify_no_nested_try_catch(Config) -> Path). -spec verify_no_successive_maps(config()) -> any(). +-if(?OTP_RELEASE < 27). + verify_no_successive_maps(Config) -> Group = proplists:get_value(group, Config, erl_files), Ext = proplists:get_value(test_file_ext, Config, "erl"), @@ -1260,6 +1262,13 @@ verify_no_successive_maps(Config) -> #{ignore => [Module]}, Path). +- else . + +verify_no_successive_maps(_Config) -> + []. + +-endif. + -spec verify_atom_naming_convention(config()) -> any(). verify_atom_naming_convention(Config) -> Group = proplists:get_value(group, Config, erl_files), From 71ea3c91523fa2c6f836644729add0a9704c4ced Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Tue, 21 May 2024 21:57:53 +0100 Subject: [PATCH 3/5] Verify format only until Erlang/OTP 26 After that the formatter breaks CI --- .github/workflows/ci.yml | 2 +- test/style_SUITE.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a886d344..62d8b4ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - name: Compile run: rebar3 compile - name: Format check - if: ${{ matrix.os == 'ubuntu-22.04' }} + if: ${{ matrix.os == 'ubuntu-22.04' && matrix.otp_vsn == '26' }} run: rebar3 format --verify - name: Run test run: rebar3 test diff --git a/test/style_SUITE.erl b/test/style_SUITE.erl index e04cb71f..b2b218f9 100644 --- a/test/style_SUITE.erl +++ b/test/style_SUITE.erl @@ -1262,7 +1262,7 @@ verify_no_successive_maps(Config) -> #{ignore => [Module]}, Path). -- else . +-else. verify_no_successive_maps(_Config) -> []. From bd52f3d86d91a7958c8afdd1fb8d4cf75f32cc2e Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Tue, 21 May 2024 22:02:59 +0100 Subject: [PATCH 4/5] Act on CI results: unbreak for non-27 --- test/style_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/style_SUITE.erl b/test/style_SUITE.erl index b2b218f9..8a8bf215 100644 --- a/test/style_SUITE.erl +++ b/test/style_SUITE.erl @@ -1251,7 +1251,7 @@ verify_no_successive_maps(Config) -> [_, _, _] = elvis_core_apply_rule(Config, elvis_style, no_successive_maps, #{}, Path); erl_files -> - [#{line_num := 6}, #{line_num := 7}, #{line_num := 8}] = + [#{line_num := 7}, #{line_num := 8}, #{line_num := 9}] = elvis_core_apply_rule(Config, elvis_style, no_successive_maps, #{}, Path) end, From 89a4ea212f2764c3ef6803a700790c55dd2e2354 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Tue, 21 May 2024 22:05:08 +0100 Subject: [PATCH 5/5] Bump CI action versions, where available --- .github/workflows/ci.yml | 6 +++--- .github/workflows/lint.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62d8b4ba..8ce633b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,14 +11,14 @@ jobs: rebar3_vsn: ['3.23'] os: [ubuntu-22.04, windows-2022] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 id: setup-beam with: otp-version: ${{matrix.otp_vsn}} rebar3-version: ${{matrix.rebar3_vsn}} - name: Restore _build - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: _build key: "_build-cache-for\ @@ -27,7 +27,7 @@ jobs: -rebar3-${{steps.setup-beam.outputs.rebar3-version}}\ -hash-${{hashFiles('rebar.lock')}}" - name: Restore rebar3's cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/rebar3 key: "rebar3-cache-for\ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5742cd21..124e5166 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # uses .markdownlint.yml for configuration - name: markdownlint - uses: DavidAnson/markdownlint-cli2-action@v11 + uses: DavidAnson/markdownlint-cli2-action@v16 with: globs: | LICENSE