class Warnings::PylintParser
Parser
class for pylint formatted files.
Constants
- ISSUE_PATTERN
- NAME
Public Instance Methods
name()
click to toggle source
# File lib/warnings/parser/pylint_parser.rb, line 18 def name NAME end
parse(file)
click to toggle source
# File lib/warnings/parser/pylint_parser.rb, line 11 def parse(file) read_lines(file).each do |line| match = line.scan(ISSUE_PATTERN) store_issue(match[0]) unless match.empty? end end
Private Instance Methods
store_issue(match)
click to toggle source
Match the regex result and store it as issue implementation.
@param match [Array<String>] The regex matches for a single issue. @return Void
# File lib/warnings/parser/pylint_parser.rb, line 28 def store_issue(match) issue = Issue.new issue.file_name = match[0] issue.line = match[1] issue.category = match[2] issue.severity = SeverityUtil.rcwef_short(issue.category) issue.message = match[3] @issues << issue end