mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Exclude reporting type declarations passed as call arguments
This commit is contained in:
parent
28fafea19f
commit
a79e711fae
2 changed files with 20 additions and 5 deletions
|
@ -388,19 +388,29 @@ module Ameba::Rule::Lint
|
|||
CRYSTAL
|
||||
end
|
||||
|
||||
it "doesn't report if this is a record declaration" do
|
||||
it "doesn't report record declaration" do
|
||||
expect_no_issues subject, <<-CRYSTAL
|
||||
record Foo, foo : String
|
||||
record Foo, foo = "foo"
|
||||
CRYSTAL
|
||||
end
|
||||
|
||||
it "doesn't report if this is a record declaration (generics)" do
|
||||
it "doesn't report record declarations (generics)" do
|
||||
expect_no_issues subject, <<-CRYSTAL
|
||||
record Foo(T), foo : T
|
||||
record Foo(T), foo = T.new
|
||||
CRYSTAL
|
||||
end
|
||||
|
||||
it "doesn't report if this is an accessor declaration" do
|
||||
it "doesn't report type declaration as a call argument" do
|
||||
expect_no_issues subject, <<-CRYSTAL
|
||||
foo Foo(T), foo : T
|
||||
foo Foo, foo : Nil
|
||||
foo foo : String, bar : Int32?
|
||||
CRYSTAL
|
||||
end
|
||||
|
||||
it "doesn't report accessor declarations" do
|
||||
accessor_macros = %w[setter class_setter]
|
||||
%w[getter class_getter property class_property].each do |name|
|
||||
accessor_macros << name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue