Skip to content

Commit a9b7d25

Browse files
authored
Fix record autolink - and bump CI (#2240)
* Do not skip autolink of record/N types, only for #record{} types. * Bump CI to latest Erlang version
1 parent 3880fd1 commit a9b7d25

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
otp: "27"
8484
# Test with latest Elixir and Erlang versions
8585
- elixir: "1.19"
86-
otp: "28"
86+
otp: "29"
8787
lint: true
8888
steps:
8989
- uses: actions/checkout@v3

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
fail-fast: true
3030
matrix:
3131
include:
32-
- otp: 26
33-
otp_version: "26.2.5"
34-
elixir_version: "1.16.2"
3532
- otp: 27
3633
otp_version: "27.3.4.9"
3734
elixir_version: "1.19.5"
3835
- otp: 28
3936
otp_version: "28.4.1"
4037
elixir_version: "1.19.5"
38+
- otp: 29
39+
otp_version: "29.0"
40+
elixir_version: "1.19.5"
4141

4242
runs-on: ubuntu-22.04
4343
steps:

lib/ex_doc/language/erlang.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ defmodule ExDoc.Language.Erlang do
570570
arity = length(args)
571571

572572
cond do
573-
name == :record and acc != [] ->
573+
name == :record and args != [] and acc != [] ->
574574
{ast, acc}
575575

576576
name in [:"::", :when, :%{}, :{}, :|, :->, :..., :fun] ->

test/ex_doc/language/erlang_test.exs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,13 @@ defmodule ExDoc.Language.ErlangTest do
708708
~s| <a href="https://www.erlang.org/doc/apps/erts/erlang.html#t:atom/0">atom</a>()}]].|
709709
end
710710

711+
if System.otp_release() >= "29" do
712+
test "spec referencing builtin record/0 type", c do
713+
assert autolink_spec("-spec foo() -> record().", c) ==
714+
~s|foo() -> <a href="https://www.erlang.org/doc/apps/erts/erlang.html#t:record/0">record</a>().|
715+
end
716+
end
717+
711718
test "callback", c do
712719
assert autolink_spec("-callback foo() -> t().", c) ==
713720
~s|foo() -> <a href="#t:t/0">t</a>().|

0 commit comments

Comments
 (0)