Sha256: d71b8710a2ba71f3e4ec19687dcdb332af6267f1cb85988185411d814666046f

Contents?: true

Size: 386 Bytes

Versions: 8

Compression:

Stored size: 386 Bytes

Contents

module SlimLint
  # Searches for tab indentation
  class Linter::Tab < Linter
    include LinterRegistry

    MSG = 'Tab detected'.freeze

    on_start do |_sexp|
      dummy_node = Struct.new(:line)
      document.source_lines.each_with_index do |line, index|
        next unless line =~ /^( *)[\t ]*\t/

        report_lint(dummy_node.new(index + 1), MSG)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
slim_lint-0.15.1 lib/slim_lint/linter/tab.rb
slim_lint-0.15.0 lib/slim_lint/linter/tab.rb
slim_lint-0.14.0 lib/slim_lint/linter/tab.rb
slim_lint-0.13.0 lib/slim_lint/linter/tab.rb
slim_lint-0.12.0 lib/slim_lint/linter/tab.rb
slim_lint-0.11.0 lib/slim_lint/linter/tab.rb
slim_lint-0.10.0 lib/slim_lint/linter/tab.rb
slim_lint-0.9.0 lib/slim_lint/linter/tab.rb