Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Issue grantmcconnaughey#62 - Add mypy parser
Browse files Browse the repository at this point in the history
  • Loading branch information
bugale committed Jul 11, 2022
1 parent a95d5e8 commit d33fd93
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lintly/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ def parse_violations(self, output):

path = self._normalize_path(match.group('path'))

groups = match.groupdict()
violation = Violation(
line=int(match.group('line')),
column=int(match.group('column')),
code=match.group('code'),
message=match.group('message')
line=int(groups.get('line', 1)),
column=int(groups.get('column', 1)),
code=groups.get('code', '').strip(),
message=groups.get('message', '').strip()
)

violations[path].append(violation)
Expand Down Expand Up @@ -299,4 +300,7 @@ def parse_violations(self, output):

# cfn-nag JSON output
'cfn-nag': CfnNagParser(),

# Mypy formatter
'mypy': LineRegexParser(r'^(?P<path>.*\.py):(?:(?P<line>\d*):)?(?:(?P<column>\d*):)? [^:]*: (?P<message>.*)$'),
}

0 comments on commit d33fd93

Please sign in to comment.