| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| 1 | import re |
||
| 8 | class CPPLintBear(LocalBear, Lint): |
||
| 9 | executable = 'cpplint' |
||
| 10 | output_regex = re.compile( |
||
| 11 | r'(?P<filename>.+\..+):(?P<line>\d+):\s(?P<message>.+)') |
||
| 12 | use_stderr = True |
||
| 13 | |||
| 14 | def run(self, |
||
| 15 | filename, |
||
| 16 | file, |
||
| 17 | cpplint_ignore: typed_list(str)=[], |
||
| 18 | cpplint_include: typed_list(str)=[]): |
||
| 19 | ''' |
||
| 20 | Checks the code with `cpplint` on each file separately. |
||
| 21 | |||
| 22 | :param cpplint_ignore: |
||
| 23 | :param cpplint_include: |
||
| 24 | ''' |
||
| 25 | ignore = ','.join('-'+part.strip() for part in cpplint_ignore) |
||
| 26 | include = ','.join('+'+part.strip() for part in cpplint_include) |
||
| 27 | self.arguments = '--filter='+ignore+','+include |
||
| 28 | return self.lint(filename) |
||
| 29 |