mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Report only wrong predicate names
This commit is contained in:
parent
dceafd26e5
commit
21abce63bd
2 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,9 @@ module Ameba::Rule
|
||||||
def picture?(x)
|
def picture?(x)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allow_this_picture?
|
||||||
|
end
|
||||||
)
|
)
|
||||||
subject.catch(s).should be_valid
|
subject.catch(s).should be_valid
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,7 +39,7 @@ module Ameba::Rule
|
||||||
end
|
end
|
||||||
|
|
||||||
def test(source, node : Crystal::Def)
|
def test(source, node : Crystal::Def)
|
||||||
if node.name =~ /(is|has)_(\w+)\?/
|
if node.name =~ /^(is|has)_(\w+)\?/
|
||||||
source.error self, node.location,
|
source.error self, node.location,
|
||||||
"Favour method name '#{$2}?' over '#{node.name}'"
|
"Favour method name '#{$2}?' over '#{node.name}'"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue