Implement Documentation rule on top of the ScopeVisitor

This commit is contained in:
Sijawusz Pur Rahnama 2023-06-08 02:04:06 +02:00
parent 4c740f394a
commit 4d8346509e
2 changed files with 31 additions and 45 deletions

View file

@ -4,15 +4,21 @@ module Ameba::Rule::Lint
subject = Documentation.new
.tap(&.ignore_classes = false)
.tap(&.ignore_modules = false)
.tap(&.ignore_enums = false)
.tap(&.ignore_defs = false)
.tap(&.ignore_macros = false)
describe Documentation do
it "passes for undocumented private types" do
expect_no_issues subject, <<-CRYSTAL
private class Foo
def foo
end
end
private module Bar
def bar
end
end
private enum Baz
@ -30,10 +36,16 @@ module Ameba::Rule::Lint
expect_no_issues subject, <<-CRYSTAL
# Foo
class Foo
# foo
def foo
end
end
# Bar
module Bar
# bar
def bar
end
end
# Baz