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