mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add a space delimiter to duplicated hash keys
This commit is contained in:
parent
9cf5d05dc0
commit
d307f01bfa
2 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ module Ameba::Rule
|
||||||
)
|
)
|
||||||
subject.catch(s).should_not be_valid
|
subject.catch(s).should_not be_valid
|
||||||
error = s.errors.first
|
error = s.errors.first
|
||||||
error.message.should eq %(Duplicated keys in hash literal: "key1","key2")
|
error.message.should eq %(Duplicated keys in hash literal: "key1", "key2")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ module Ameba::Rule
|
||||||
return unless (keys = duplicated_keys(node.entries)).any?
|
return unless (keys = duplicated_keys(node.entries)).any?
|
||||||
|
|
||||||
source.error self, node.location,
|
source.error self, node.location,
|
||||||
"Duplicated keys in hash literal: #{keys.join(",")}"
|
"Duplicated keys in hash literal: #{keys.join(", ")}"
|
||||||
end
|
end
|
||||||
|
|
||||||
private def duplicated_keys(entries)
|
private def duplicated_keys(entries)
|
||||||
|
|
Loading…
Reference in a new issue