Answer prose round one: the chunk as the agent's current work, the release last in its list, one idea per comment, the changelog for its reader
This commit is contained in:
@@ -10,7 +10,7 @@ def bound(node: ast.Import | ast.ImportFrom) -> list[str]:
|
||||
|
||||
|
||||
def unsorted_imports(source: str) -> list[int]:
|
||||
"""The lines of the imports that list their names out of order, or sort before the import on the line above."""
|
||||
"""The line numbers of imports whose names are out of order, or whose first name sorts before the first name of the import on the line above, ignoring case."""
|
||||
imports = [node for node in ast.parse(source).body if isinstance(node, ast.Import | ast.ImportFrom)]
|
||||
names_out = [node.lineno for node in imports if bound(node) != sorted(bound(node), key=str.casefold)]
|
||||
lines_out = [node.lineno for above, node in zip(imports, imports[1:]) if node.lineno == above.end_lineno + 1 and bound(node)[0].casefold() < bound(above)[0].casefold()]
|
||||
|
||||
Reference in New Issue
Block a user