Sha256: 6b772ed5a53bcf53842c93c2e47636d217a985f534f7dd29a93fd429fb8c2376

Contents?: true

Size: 446 Bytes

Versions: 23

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

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

23 entries across 23 versions & 1 rubygems

Version Path
slim_lint-0.31.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.31.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.30.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.29.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.28.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.27.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.26.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.25.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.24.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.23.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.22.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.22.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.21.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.21.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.20.2 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.20.1 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.20.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.19.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.18.0 lib/slim_lint/linter/trailing_whitespace.rb
slim_lint-0.17.1 lib/slim_lint/linter/trailing_whitespace.rb