-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
Refs #1168
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,21 @@ defmodule Credo.Check.Readability.ModuleDocTest do | |
|> refute_issues() | ||
end | ||
|
||
test "it should NOT report modules or submodules when @moduledoc is present" do | ||
""" | ||
defmodule Foo do | ||
@moduledoc false | ||
defmodule Bar do | ||
@moduledoc false | ||
end | ||
end | ||
""" | ||
|> to_source_file | ||
|> run_check(@described_check, ignore_names: []) | ||
|> refute_issues() | ||
end | ||
|
||
# | ||
# cases raising issues | ||
# | ||
|
@@ -70,6 +85,20 @@ defmodule Credo.Check.Readability.ModuleDocTest do | |
|> assert_issue() | ||
end | ||
|
||
test "it should report modules when @moduledoc is present in submodules only" do | ||
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / all triggers are looked up and confirmed
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.13.4 OTP 24.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.14.5 OTP 24.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.13.4 OTP 25.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.17.3 OTP 25.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.15.7 OTP 25.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.16.2 OTP 25.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.18.0-rc.0 OTP 25.3
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.17.3 OTP 26.2
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.15.7 OTP 26.2
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.18.0-rc.0 OTP 26.2
Check failure on line 88 in test/credo/check/readability/module_doc_test.exs GitHub Actions / Elixir 1.16.2 OTP 26.2
|
||
""" | ||
defmodule Foo do | ||
# distinctly no moduledoc here | ||
defmodule Bar do | ||
@moduledoc false | ||
end | ||
end | ||
""" | ||
|> to_source_file | ||
|> run_check(@described_check, ignore_names: []) | ||
|> assert_issue() | ||
end | ||
|
||
test "it should report empty strings" do | ||
""" | ||
defmodule CredoSampleModule do | ||
|