lib/scss_lint/linter/trailing_semicolon.rb in scss-lint-0.28.0 vs lib/scss_lint/linter/trailing_semicolon.rb in scss-lint-0.29.0

- old
+ new

@@ -36,15 +36,23 @@ elsif !ends_with_semicolon?(node) line = node.source_range.start_pos.line add_lint line, 'Declaration should not have a space before ' \ 'the terminating semicolon' + elsif ends_with_multiple_semicolons?(node) + line = node.source_range.start_pos.line + add_lint line, 'Declaration should be terminated by a single semicolon' end end # Checks that the node is ended by a semicolon (with no whitespace) def ends_with_semicolon?(node) source_from_range(node.source_range) =~ /;$/ + end + + def ends_with_multiple_semicolons?(node) + # Look one character past the end to see if there's another semicolon + character_at(node.source_range.end_pos, 1) == ';' end def has_space_before_semicolon?(node) source_from_range(node.source_range) =~ /\s;$/ end