class Object

Public Instance Methods

check() click to toggle source
# File lib/puppet-lint/plugins/check_empty_trailing_lines.rb, line 2
def check
  last_token = tokens.last

  if [:NEWLINE, :WHITESPACE, :INDENT].include?(last_token.prev_token.type)
    notify :warning, {
      :message => 'too many empty lines at the end of the file',
      :line    => last_token.prev_token.line,
      :column  => manifest_lines.last.length,
    }
  end
end
fix(problem) click to toggle source
# File lib/puppet-lint/plugins/check_empty_trailing_lines.rb, line 14
def fix(problem)
  remove_token(tokens.last.prev_token)
  if tokens.last.prev_token.type == :NEWLINE && tokens.last.type == :NEWLINE
    fix(problem)
  end
end