| Conditions | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | from isort import SortImports |
||
| 9 | def run(self, |
||
| 10 | filename, |
||
| 11 | file): |
||
| 12 | """ |
||
| 13 | Sorts imports for python. |
||
| 14 | """ |
||
| 15 | new_file = SortImports( |
||
| 16 | file_contents=''.join(file)).output.splitlines(True) |
||
| 17 | if new_file != file: |
||
| 18 | diff = Diff.from_string_arrays(file, new_file) |
||
| 19 | yield Result(self, |
||
| 20 | "Imports can be sorted.", |
||
| 21 | affected_code=diff.affected_code(filename), |
||
| 22 | diffs={filename: diff}) |
||
| 23 |