class Appium::Lint::LineBreakInvalid

line breaks such as ‘–` and `—` shouldn’t be used on Slate. They will cause problems such as null divs

Constants

FAIL

Public Instance Methods

call() click to toggle source
# File lib/appium_doc_lint/lint/line_break_invalid.rb, line 7
def call
  previous_line = ''
  input.lines.each_with_index do |line, index|
    # If the previous line isn't empty then --- createa a h2 not a line break.
    previous_line_empty = previous_line.match(/^\s*$/)
    line_break_invalid  = previous_line_empty && line.match(/^--+\s*$/)
    warn index if line_break_invalid

    previous_line = line
  end

  warnings
end
fail() click to toggle source
# File lib/appium_doc_lint/lint/line_break_invalid.rb, line 23
def fail
  FAIL
end