Merge pull request #376 from crystal-ameba/update-to-work-with-crystal-nightly

This commit is contained in:
Sijawusz Pur Rahnama 2023-07-11 23:50:14 +02:00 committed by GitHub
commit a33f98624a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -44,7 +44,7 @@ module Ameba::Rule::Lint
foo = 1 foo = 1
-> (foo : Int32) {} -> (foo : Int32) {}
# ^ error: Shadowing outer local variable `foo` # ^^^^^^^^^^^ error: Shadowing outer local variable `foo`
end end
CRYSTAL CRYSTAL
end end
@ -69,7 +69,7 @@ module Ameba::Rule::Lint
3.times do |foo| 3.times do |foo|
# ^ error: Shadowing outer local variable `foo` # ^ error: Shadowing outer local variable `foo`
-> (foo : Int32) { foo + 1 } -> (foo : Int32) { foo + 1 }
# ^ error: Shadowing outer local variable `foo` # ^^^^^^^^^^^ error: Shadowing outer local variable `foo`
end end
CRYSTAL CRYSTAL
end end

View file

@ -115,12 +115,12 @@ module Ameba::Rule::Lint
first.rule.should_not be_nil first.rule.should_not be_nil
first.location.to_s.should eq "source_spec.cr:1:11" first.location.to_s.should eq "source_spec.cr:1:11"
first.end_location.to_s.should eq "" first.end_location.to_s.should eq "source_spec.cr:1:21"
first.message.should eq "Focused spec item detected" first.message.should eq "Focused spec item detected"
second.rule.should_not be_nil second.rule.should_not be_nil
second.location.to_s.should eq "source_spec.cr:2:13" second.location.to_s.should eq "source_spec.cr:2:13"
second.end_location.to_s.should eq "" second.end_location.to_s.should eq "source_spec.cr:2:23"
second.message.should eq "Focused spec item detected" second.message.should eq "Focused spec item detected"
end end
end end

View file

@ -52,7 +52,7 @@ module Ameba::Rule::Lint
it "reports if proc argument is unused" do it "reports if proc argument is unused" do
source = expect_issue subject, <<-CRYSTAL source = expect_issue subject, <<-CRYSTAL
-> (a : Int32, b : String) do -> (a : Int32, b : String) do
# ^ error: Unused argument `b`. If it's necessary, use `_b` as an argument name to indicate that it won't be used. # ^^^^^^^^^^ error: Unused argument `b`. If it's necessary, use `_b` as an argument name to indicate that it won't be used.
a = a + 1 a = a + 1
end end
CRYSTAL CRYSTAL
@ -306,7 +306,7 @@ module Ameba::Rule::Lint
expect_issue rule, <<-CRYSTAL expect_issue rule, <<-CRYSTAL
->(a : Int32) {} ->(a : Int32) {}
# ^ error: Unused argument `a`. If it's necessary, use `_a` as an argument name to indicate that it won't be used. # ^^^^^^^^^ error: Unused argument `a`. If it's necessary, use `_a` as an argument name to indicate that it won't be used.
CRYSTAL CRYSTAL
end end
end end