From 1f40b91a875c98b2e768197f015057b65a6de181 Mon Sep 17 00:00:00 2001 From: Andreas Hasselberg Date: Mon, 14 Sep 2026 12:00:56 +0200 Subject: [PATCH 1/3] Update CI and local Erlang/OTP version pins to latest releases Bump the rebar3 CI matrix pin and .tool-versions erlang pin to their latest patch releases, and update the CI ELP download to the latest ELP release (2026-08-10), which now also ships an OTP 29 build. Migrate .elp_lint.toml to ELP's new [linters.] config schema required by that release. Co-Authored-By: Claude Sonnet 5 --- .elp_lint.toml | 12 +++++++++++- .github/workflows/ci.yml | 9 +++++---- .tool-versions | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.elp_lint.toml b/.elp_lint.toml index aa5241da..3ab3555f 100644 --- a/.elp_lint.toml +++ b/.elp_lint.toml @@ -1 +1,11 @@ -disabled_lints = ['W0012', 'W0046', 'W0051', 'W0066'] +[linters.W0012] +enabled = false + +[linters.W0046] +enabled = false + +[linters.W0051] +enabled = false + +[linters.W0066] +enabled = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 718f1b24..47f08de8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,15 @@ jobs: strategy: matrix: otp: ["29", "28", "27"] - rebar3: ["3.25"] + rebar3: ["3.27"] include: # ELP (used by the lint and type_check steps) ships per-OTP builds. - # There is no OTP 29 build yet, so those steps are skipped on OTP 29. + - otp: "29" + elp_build: "https://github.com/WhatsApp/erlang-language-platform/releases/download/2026-08-10/elp-linux-x86_64-unknown-linux-gnu-otp-29.tar.gz" - otp: "28" - elp_build: "https://github.com/WhatsApp/erlang-language-platform/releases/download/2026-02-27/elp-linux-x86_64-unknown-linux-gnu-otp-28.tar.gz" + elp_build: "https://github.com/WhatsApp/erlang-language-platform/releases/download/2026-08-10/elp-linux-x86_64-unknown-linux-gnu-otp-28.5.tar.gz" - otp: "27" - elp_build: "https://github.com/WhatsApp/erlang-language-platform/releases/download/2026-02-27/elp-linux-x86_64-unknown-linux-gnu-otp-27.3.tar.gz" + elp_build: "https://github.com/WhatsApp/erlang-language-platform/releases/download/2026-08-10/elp-linux-x86_64-unknown-linux-gnu-otp-27.3.tar.gz" steps: - uses: actions/checkout@v4 diff --git a/.tool-versions b/.tool-versions index f9958218..6c925dc7 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ elixir 1.18.4 -erlang 28.2 +erlang 28.5.0.6 rebar 3.27.0 From d6eec3c8fd2cb15d9dcc81c47b1a3df6e9ed02d9 Mon Sep 17 00:00:00 2001 From: Andreas Hasselberg Date: Mon, 14 Sep 2026 12:09:39 +0200 Subject: [PATCH 2/3] Fix lint failures surfaced by the ELP version bump The 2026-08-10 ELP release always lints test files now (previously skipped). Scope the newly-triggered noisy lints (unused record fields, module-level nowarn, old EDoc comments, maps:put/maps:reverse idioms, and a parse error from the test-only spectra_transform parse_transform) back to non-test code via include_tests = false, restoring prior lint scope. Also fix the one genuine new finding in production code: replace maps:find/2 with map-pattern matching in spectra_json:struct_default_value/2 (W0032). Co-Authored-By: Claude Sonnet 5 --- .elp_lint.toml | 30 ++++++++++++++++++++++++++++++ src/spectra_json.erl | 6 +++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.elp_lint.toml b/.elp_lint.toml index 3ab3555f..ccd573af 100644 --- a/.elp_lint.toml +++ b/.elp_lint.toml @@ -9,3 +9,33 @@ enabled = false [linters.W0066] enabled = false + +# The ELP release from 2026-08-10 started always linting test files +# (previously test files were skipped). These lints are noisy on test +# fixtures/helpers (over-specified records, intentional nowarn_*, +# EDoc-style comments in older test helpers, includes kept for type +# reference) so keep them scoped to non-test code as before. +[linters.W0003] +include_tests = false + +[linters.W0020] +include_tests = false + +[linters.W0038] +include_tests = false + +[linters.W0054] +include_tests = false + +[linters.W0030] +include_tests = false + +[linters.W0056] +include_tests = false + +# The custom `spectra_transform` parse_transform used only by the test +# suite can't be resolved when ELP parses test modules that use it in +# isolation, which trips this lint. Restore the previous behavior of +# not linting test files for this diagnostic. +[linters.L0002] +include_tests = false diff --git a/src/spectra_json.erl b/src/spectra_json.erl index 846c535b..8920614b 100644 --- a/src/spectra_json.erl +++ b/src/spectra_json.erl @@ -1096,9 +1096,9 @@ field_default_value(#sp_rec_field{default = undefined}) -> undefined. struct_default_value(undefined, _FieldName) -> error; struct_default_value(Defaults, FieldName) -> - case maps:find(FieldName, Defaults) of - {ok, V} when V =/= nil, V =/= undefined -> {ok, V}; - _ -> error + case Defaults of + #{FieldName := V} when V =/= nil, V =/= undefined -> {ok, V}; + #{} -> error end. -spec append_error_location([spectra:error()], atom() | integer()) -> [spectra:error()]. From 9f6e497e62019f2843c92318bc0513ef59c83e11 Mon Sep 17 00:00:00 2001 From: Andreas Hasselberg Date: Mon, 14 Sep 2026 12:14:30 +0200 Subject: [PATCH 3/3] Suppress L0002 for test files using the spectra_transform parse_transform ELP cannot execute arbitrary parse transforms during analysis (see WhatsApp/erlang-language-platform#39), so files applying the project's own spectra_transform parse_transform fail to parse under elp lint with L0002. Use ELP's documented elp:ignore mechanism on each affected test file instead of the ineffective include_tests config key (L0002 is a hard parse failure, not a post-parse lint, so it isn't scoped by include_tests). Co-Authored-By: Claude Sonnet 5 --- .elp_lint.toml | 7 ------- test/spectra_test_module_transform.erl | 1 + test/spectra_test_module_transform_export_only.erl | 1 + test/spectra_test_module_transform_function_only.erl | 1 + test/spectra_test_module_transform_preserves.erl | 1 + test/spectra_test_module_transform_spec_doc.erl | 1 + test/spectra_test_module_transform_spec_only.erl | 1 + 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.elp_lint.toml b/.elp_lint.toml index ccd573af..ce7e9ab1 100644 --- a/.elp_lint.toml +++ b/.elp_lint.toml @@ -32,10 +32,3 @@ include_tests = false [linters.W0056] include_tests = false - -# The custom `spectra_transform` parse_transform used only by the test -# suite can't be resolved when ELP parses test modules that use it in -# isolation, which trips this lint. Restore the previous behavior of -# not linting test files for this diagnostic. -[linters.L0002] -include_tests = false diff --git a/test/spectra_test_module_transform.erl b/test/spectra_test_module_transform.erl index 8e4885d7..efc57e93 100644 --- a/test/spectra_test_module_transform.erl +++ b/test/spectra_test_module_transform.erl @@ -1,3 +1,4 @@ +% elp:ignore L0002 - ELP cannot run the spectra_transform parse_transform -module(spectra_test_module_transform). -compile({parse_transform, spectra_transform}). diff --git a/test/spectra_test_module_transform_export_only.erl b/test/spectra_test_module_transform_export_only.erl index 901ab217..b2987171 100644 --- a/test/spectra_test_module_transform_export_only.erl +++ b/test/spectra_test_module_transform_export_only.erl @@ -1,3 +1,4 @@ +% elp:ignore L0002 - ELP cannot run the spectra_transform parse_transform -module(spectra_test_module_transform_export_only). -compile({parse_transform, spectra_transform}). diff --git a/test/spectra_test_module_transform_function_only.erl b/test/spectra_test_module_transform_function_only.erl index 3dce0edc..5107a292 100644 --- a/test/spectra_test_module_transform_function_only.erl +++ b/test/spectra_test_module_transform_function_only.erl @@ -1,3 +1,4 @@ +% elp:ignore L0002 - ELP cannot run the spectra_transform parse_transform -module(spectra_test_module_transform_function_only). -compile({parse_transform, spectra_transform}). diff --git a/test/spectra_test_module_transform_preserves.erl b/test/spectra_test_module_transform_preserves.erl index bb687808..2b6c1150 100644 --- a/test/spectra_test_module_transform_preserves.erl +++ b/test/spectra_test_module_transform_preserves.erl @@ -1,3 +1,4 @@ +% elp:ignore L0002 - ELP cannot run the spectra_transform parse_transform -module(spectra_test_module_transform_preserves). -compile({parse_transform, spectra_transform}). diff --git a/test/spectra_test_module_transform_spec_doc.erl b/test/spectra_test_module_transform_spec_doc.erl index 6956293c..133817b7 100644 --- a/test/spectra_test_module_transform_spec_doc.erl +++ b/test/spectra_test_module_transform_spec_doc.erl @@ -1,3 +1,4 @@ +% elp:ignore L0002 - ELP cannot run the spectra_transform parse_transform -module(spectra_test_module_transform_spec_doc). -compile({parse_transform, spectra_transform}). diff --git a/test/spectra_test_module_transform_spec_only.erl b/test/spectra_test_module_transform_spec_only.erl index 83726c00..748c88bd 100644 --- a/test/spectra_test_module_transform_spec_only.erl +++ b/test/spectra_test_module_transform_spec_only.erl @@ -1,3 +1,4 @@ +% elp:ignore L0002 - ELP cannot run the spectra_transform parse_transform -module(spectra_test_module_transform_spec_only). -compile({parse_transform, spectra_transform}).