class HamlLint::Lint
Contains information about a problem or issue with a HAML document.
Attributes
corrected[R]
@return [Boolean] If the error was corrected by auto-correct
filename[R]
@return [String] file path to which the lint applies
line[R]
@return [String] line number of the file the lint corresponds to
linter[R]
@return [SlimLint::Linter] linter that reported the lint
message[R]
@return [String] error/warning message to display to user
severity[R]
@return [Symbol] whether this lint is a warning or an error
Public Class Methods
new(linter, filename, line, message, severity = :warning, corrected: false)
click to toggle source
Creates a new lint.
@param linter [HamlLint::Linter] @param filename [String] @param line [Fixnum] @param message [String] @param severity [Symbol]
# File lib/haml_lint/lint.rb, line 31 def initialize(linter, filename, line, message, severity = :warning, corrected: false) # rubocop:disable Metrics/ParameterLists @linter = linter @filename = filename @line = line || 0 @message = message @severity = Severity.new(severity) @corrected = corrected end
Public Instance Methods
error?()
click to toggle source
Return whether this lint has a severity of error.
@return [Boolean]
# File lib/haml_lint/lint.rb, line 43 def error? @severity.error? end
inspect()
click to toggle source
# File lib/haml_lint/lint.rb, line 47 def inspect "#{self.class.name}(corrected=#{corrected}, filename=#{filename}, line=#{line}, " \ "linter=#{linter.class.name}, message=#{message}, severity=#{severity})" end