| Total Complexity | 3 |
| Total Lines | 11 |
| Duplicated Lines | 0 % |
| 1 | from coalib.bearlib.abstractions.CorrectionBasedBear import CorrectionBasedBear |
||
| 4 | class GoImportsBear(CorrectionBasedBear): |
||
| 5 | executable = 'goimports' |
||
| 6 | RESULT_MESSAGE = "Imports need to be added/removed." |
||
| 7 | |||
| 8 | def run(self, filename, file): |
||
| 9 | """ |
||
| 10 | Adds/Removes imports to Go code for missing imports. |
||
| 11 | """ |
||
| 12 | for result in self.retrieve_results(filename, file, cli_options=''): |
||
| 13 | if result != file: |
||
| 14 | yield result |
||
| 15 |