class Appium::Lint::H2Invalid

h2 must use the ‘##` syntax and not the `—` underline syntax. check for three - to reduce false positives

Constants

FAIL

Public Instance Methods

call() click to toggle source
# File lib/appium_doc_lint/lint/h2_invalid.rb, line 7
def call
  previous_line = ''

  input.lines.each_with_index do |line, index|
    # If the previous line is empty then --- triggers a line break
    previous_line_not_empty = !previous_line.match(/^\s*$/)
    h2_invalid              = previous_line_not_empty && line.match(/^---+\s*$/)
    warn index if h2_invalid

    previous_line = line
  end

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