Sha256: 4de75b87ab984426d9d7ee06ee5d37154e9e8dd5175a06c96214249366816adb

Contents?: true

Size: 415 Bytes

Versions: 22

Compression:

Stored size: 415 Bytes

Contents

module SlimLint
  # Checks for trailing whitespace.
  class Linter::TrailingWhitespace < Linter
    include LinterRegistry

    on_start do |_sexp|
      dummy_node = Struct.new(:line)

      document.source_lines.each_with_index do |line, index|
        next unless line =~ /\s+$/

        report_lint(dummy_node.new(index + 1),
                    'Line contains trailing whitespace')
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
slim_lint-0.15.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.15.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.14.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.13.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.12.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.11.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.10.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.9.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.8.3 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.8.2 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.8.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.8.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.7.2 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.7.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.7.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.6.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.6.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.5.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.4.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.3.0 lib/slim_lint/linter/trailing_whitespace.rb