Sha256: 3e55fd273908722214590977721654fe260f411279dd9bf2cc07e41db8531804
Contents?: true
Size: 649 Bytes
Versions: 23
Compression:
Stored size: 649 Bytes
Contents
# frozen_string_literal: true module SlimLint # This linter looks for trailing blank lines and a final newline. class Linter::TrailingBlankLines < Linter include LinterRegistry on_start do |_sexp| dummy_node = Struct.new(:line) next if document.source.empty? if !document.source.end_with?("\n") report_lint(dummy_node.new(document.source_lines.size), 'No blank line in the end of file') elsif document.source.lines.last.blank? report_lint(dummy_node.new(document.source.lines.size), 'Multiple empty lines in the end of file') end end end end
Version data entries
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
slim_lint-0.17.0 | lib/slim_lint/linter/trailing_blank_lines.rb |
slim_lint-0.16.1 | lib/slim_lint/linter/trailing_blank_lines.rb |
slim_lint-0.16.0 | lib/slim_lint/linter/trailing_blank_lines.rb |