Commit bfa64f5 1 parent cf40ca2 commit bfa64f5 Copy full SHA for bfa64f5
File tree 1 file changed +29
-0
lines changed
test/credo/check/readability
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,21 @@ defmodule Credo.Check.Readability.ModuleDocTest do
53
53
|> refute_issues ( )
54
54
end
55
55
56
+ test "it should NOT report modules or submodules when @moduledoc is present" do
57
+ """
58
+ defmodule Foo do
59
+ @moduledoc false
60
+
61
+ defmodule Bar do
62
+ @moduledoc false
63
+ end
64
+ end
65
+ """
66
+ |> to_source_file
67
+ |> run_check ( @ described_check , ignore_names: [ ] )
68
+ |> refute_issues ( )
69
+ end
70
+
56
71
#
57
72
# cases raising issues
58
73
#
@@ -70,6 +85,20 @@ defmodule Credo.Check.Readability.ModuleDocTest do
70
85
|> assert_issue ( )
71
86
end
72
87
88
+ test "it should report modules when @moduledoc is present in submodules only" do
89
+ """
90
+ defmodule Foo do
91
+ # distinctly no moduledoc here
92
+ defmodule Bar do
93
+ @moduledoc false
94
+ end
95
+ end
96
+ """
97
+ |> to_source_file
98
+ |> run_check ( @ described_check , ignore_names: [ ] )
99
+ |> assert_issue ( )
100
+ end
101
+
73
102
test "it should report empty strings" do
74
103
"""
75
104
defmodule CredoSampleModule do
You can’t perform that action at this time.
0 commit comments