Class: CheckstyleReport::CheckstyleError

Inherits:
Object
  • Object
show all
Defined in:
lib/checkstyle_report/checkstyle_report.rb

Overview

Represents a single error in Checkstyle format.

Constant Summary collapse

SEVERITY_NORMAL =

Severity levels for Checkstyle errors.

'normal'
SEVERITY_WARNING =
'warning'
SEVERITY_ERROR =
'error'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(severity, message, source, line, column, name) ⇒ CheckstyleError

Initializes a new instance of CheckstyleError.

Must be one of SEVERITY_NORMAL, SEVERITY_WARNING, or SEVERITY_ERROR.

Parameters:

  • severity (CheckstyleError)

    The severity level of the error.

  • message (String)

    The error message.

  • source (String)

    The source of the error.

  • line (Integer)

    The line number where the error occurred.

  • column (Integer)

    The column number where the error occurred.

  • name (String)

    The name of the error.



119
120
121
122
123
124
125
126
# File 'lib/checkstyle_report/checkstyle_report.rb', line 119

def initialize(severity, message, source, line, column, name)
  @severity = severity
  @message = message
  @source = source
  @line = line
  @column = column
  @name = name
end

Instance Attribute Details

#columnInteger (readonly)

Returns the column number where the error occurred.

Returns:

  • (Integer)

    The column number where the error occurred.



151
152
153
# File 'lib/checkstyle_report/checkstyle_report.rb', line 151

def column
  @column
end

#lineInteger (readonly)

Returns the line number where the error occurred.

Returns:

  • (Integer)

    The line number where the error occurred.



146
147
148
# File 'lib/checkstyle_report/checkstyle_report.rb', line 146

def line
  @line
end

#messageString (readonly)

Returns the error message.

Returns:

  • (String)

    The error message.



136
137
138
# File 'lib/checkstyle_report/checkstyle_report.rb', line 136

def message
  @message
end

#nameString (readonly)

Returns the name of the error.

Returns:

  • (String)

    The name of the error.



156
157
158
# File 'lib/checkstyle_report/checkstyle_report.rb', line 156

def name
  @name
end

#severityString (readonly)

Returns the severity level of the error.

Returns:

  • (String)

    The severity level of the error.



131
132
133
# File 'lib/checkstyle_report/checkstyle_report.rb', line 131

def severity
  @severity
end

#sourceString (readonly)

Returns the source of the error.

Returns:

  • (String)

    The source of the error.



141
142
143
# File 'lib/checkstyle_report/checkstyle_report.rb', line 141

def source
  @source
end