| Total Complexity | 2 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| 1 | import re |
||
| 7 | class GoLintBear(LocalBear, Lint): |
||
| 8 | executable = 'golint' |
||
| 9 | arguments = ('-min_confidence=0.8') |
||
| 10 | output_regex = re.compile( |
||
| 11 | r'(?P<path>.*?)\:(?P<line>\d+)\:(?P<column>\d+)\: (?P<message>.*)') |
||
| 12 | use_stdout = True |
||
| 13 | |||
| 14 | def run(self, |
||
| 15 | filename, |
||
| 16 | file, |
||
| 17 | golint_cli_options: str=""): |
||
| 18 | ''' |
||
| 19 | Checks the code using `golint`. This will run golint over each file |
||
| 20 | seperately. |
||
| 21 | |||
| 22 | :param golint_cli_options: Any other flags you wish to pass to golint |
||
| 23 | can be passed. |
||
| 24 | ''' |
||
| 25 | if golint_cli_options: |
||
| 26 | self.arguments += " " + golint_cli_options |
||
| 27 | |||
| 28 | return self.lint(filename) |
||
| 29 |