formula_desc_cop: Fix the 'full stop at end of description' autocorrect

- It wasn't working because desc strings end in quotes, not just full
  stops.
This commit is contained in:
Isabell Long 2017-11-01 19:17:17 +00:00
parent 0786d41693
commit 5cbb414797

View File

@ -103,7 +103,7 @@ module RuboCop
correction.gsub!(/(^|[^a-z])#{@formula_name}([^a-z]|$)/i, "\\1\\2") correction.gsub!(/(^|[^a-z])#{@formula_name}([^a-z]|$)/i, "\\1\\2")
correction.gsub!(/^(['"]?)\s+/, "\\1") correction.gsub!(/^(['"]?)\s+/, "\\1")
correction.gsub!(/\s+(['"]?)$/, "\\1") correction.gsub!(/\s+(['"]?)$/, "\\1")
correction.gsub!(/\.$/, "") correction.gsub!(/\.(['"]?)$/, "\\1")
corrector.insert_before(node.source_range, correction) corrector.insert_before(node.source_range, correction)
corrector.remove(node.source_range) corrector.remove(node.source_range)
end end