| Total Complexity | 3 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| 1 | import re |
||
| 7 | class AlexBear(CorrectionBasedBear): |
||
| 8 | BINARY = 'alex' |
||
| 9 | REGEX = (r'^\s+(?P<line>\d+):(?P<col>\d+)\-(?P<toline>\d+):(?P<tocol>\d+)' |
||
| 10 | r'\s+(?:(?P<warning>warning)) (?P<message>.+)') |
||
| 11 | |||
| 12 | def run(self, filename, file): |
||
| 13 | output, errors = self._run_process(file, '') |
||
| 14 | self._print_errors(errors) |
||
| 15 | |||
| 16 | for line in output: |
||
| 17 | match = re.match(self.REGEX, line) |
||
| 18 | if match: |
||
| 19 | groupdict = match.groupdict() |
||
| 20 | yield Result.from_values(self, |
||
| 21 | groupdict['message'], |
||
| 22 | filename, |
||
| 23 | line=int(groupdict['line']), |
||
| 24 | column=int(groupdict['col']), |
||
| 25 | end_line=int(groupdict['toline']), |
||
| 26 | end_column=int(groupdict['tocol'])) |
||
| 27 |