mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Use prefer_name_location: true
in PredicateName
rule
This commit is contained in:
parent
15d241e138
commit
633ed7538e
2 changed files with 8 additions and 2 deletions
|
@ -21,8 +21,14 @@ module Ameba::Rule::Naming
|
||||||
|
|
||||||
it "fails if predicate name is wrong" do
|
it "fails if predicate name is wrong" do
|
||||||
expect_issue subject, <<-CRYSTAL
|
expect_issue subject, <<-CRYSTAL
|
||||||
|
class Image
|
||||||
|
def self.is_valid?(x)
|
||||||
|
# ^^^^^^^^^ error: Favour method name 'valid?' over 'is_valid?'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def is_valid?(x)
|
def is_valid?(x)
|
||||||
# ^^^^^^^^^^^^^^ error: Favour method name 'valid?' over 'is_valid?'
|
# ^^^^^^^^^ error: Favour method name 'valid?' over 'is_valid?'
|
||||||
end
|
end
|
||||||
CRYSTAL
|
CRYSTAL
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,7 +34,7 @@ module Ameba::Rule::Naming
|
||||||
return unless node.name =~ /^is_([a-z]\w*)\?$/
|
return unless node.name =~ /^is_([a-z]\w*)\?$/
|
||||||
alternative = $1
|
alternative = $1
|
||||||
|
|
||||||
issue_for node, MSG % {alternative, node.name}
|
issue_for node, MSG % {alternative, node.name}, prefer_name_location: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue