Skip to content

Commit 00ea99f

Browse files
author
José Valim
committed
Merge pull request #92 from pminten/sort-callbacks
Sort callbacks alphabetically
2 parents a590413 + d21ee83 commit 00ea99f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ex_doc/retriever.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ defmodule ExDoc.Retriever do
9191

9292
if type == :behaviour do
9393
callbacks = Kernel.Typespec.beam_callbacks(module) || []
94-
docs = Enum.map(module.__behaviour__(:docs),
94+
docs = Enum.map(Enum.sort(module.__behaviour__(:docs)),
9595
&get_callback(&1, source_path, source_url, callbacks)) ++ docs
9696
end
9797

test/ex_doc/retriever_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ defmodule ExDoc.RetrieverTest do
146146
test "undocumented callback implementations get default doc" do
147147
[node] = docs_from_files(["CustomBehaviour", "CustomBehaviourTwo", "CustomBehaviourImpl"])
148148
|> Enum.filter(&match?(ExDoc.ModuleNode[id: "CustomBehaviourImpl"], &1))
149-
docs = Enum.sort(node.docs)
149+
docs = node.docs
150150
assert Enum.map(docs, &(&1.id)) == ["bye/1", "hello/1"]
151151
assert Enum.at(docs, 0).doc ==
152152
"A doc for this so it doesn't use 'Callback implementation of'"

0 commit comments

Comments
 (0)