mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Merge pull request #376 from crystal-ameba/update-to-work-with-crystal-nightly
This commit is contained in:
commit
a33f98624a
3 changed files with 6 additions and 6 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue