audit: check for block inreplace with single sub. (#254)
There are unnecessarily verbose, have been documented to be avoided and it’s good to nudge people towards the other style.
This commit is contained in:
parent
d2c9a923ea
commit
e825f59754
@ -182,6 +182,10 @@ class FormulaAuditor
|
|||||||
problem "'__END__' was found, but 'DATA' is not used"
|
problem "'__END__' was found, but 'DATA' is not used"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if text =~ /inreplace [^\n]* do [^\n]*\n[^\n]*\.gsub![^\n]*\n\ *end/m
|
||||||
|
problem "'inreplace ... do' was used for a single substitution (use the non-block form instead)."
|
||||||
|
end
|
||||||
|
|
||||||
unless text.has_trailing_newline?
|
unless text.has_trailing_newline?
|
||||||
problem "File should end with a newline"
|
problem "File should end with a newline"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user