Skip to content

Commit

Permalink
Fix tags task issue (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickNeck authored Jul 2, 2024
1 parent 3fa7f58 commit b508e43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/recode/task/tags.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Recode.Task.Tags do
Source.add_issues(source, issues)
end

defp check_tags(%Zipper{node: {doc, _meta, args}} = zipper, issues, opts)
defp check_tags(%Zipper{node: {:@, _, [{doc, _, args}]}} = zipper, issues, opts)
when doc in [:moduledoc, :doc, :shortdoc] do
issues =
if opts[:include_docs] && doc?(args) do
Expand Down
10 changes: 10 additions & 0 deletions test/recode/task/tags_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ defmodule Recode.Task.TagsTest do
|> refute_issues()
end

test "triggers no issue for doc function" do
~s'''
defmodule Foo do
def doc(:x), do: :x
end
'''
|> run_task(Tags, tag: "TODO", reporter: Tags)
|> refute_issues()
end

#
# cases raising issues
#
Expand Down

0 comments on commit b508e43

Please sign in to comment.