From e516f838f5a9e1f1c7f0acae7d30297731ef8de3 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 18 May 2024 18:59:39 -0700 Subject: [PATCH] aider: Fix import sorting in `aider/linter.py` to resolve `isort` failure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Aider chat conversation: USER: # Running: {cmd] If the output below indicates errors or problems, fix them. But if the command fixed all the issues itself, don't take further action. isort....................................................................Failed - hook id: isort - files were modified by this hook Fixing /Users/gauthier/Projects/aider/aider/linter.py black....................................................................Passed flake8...................................................................Passed USER: # Running: {cmd] If the output below indicates errors or problems, fix them. But if the command fixed all the issues itself, don't take further action. isort....................................................................Failed - hook id: isort - files were modified by this hook Fixing /Users/gauthier/Projects/aider/aider/linter.py black....................................................................Passed flake8...................................................................Passed ASSISTANT: To fix the `isort` issues, we need to sort the imports in `aider/linter.py`. Here is the *SEARCH/REPLACE* block to apply the necessary changes: aider/linter.py ```python <<<<<<< SEARCH import os import subprocess import sys import traceback import warnings from pathlib import Path from grep_ast import TreeContext, filename_to_lang from aider.dump import dump # noqa: F401 # tree_sitter is throwing a FutureWarning warnings.simplefilter("ignore", category=FutureWarning) from tree_sitter_languages import get_parser # noqa: E402 ======= import os import subprocess import sys import traceback import warnings from pathlib import Path from grep_ast import TreeContext, filename_to_lang from tree_sitter_languages import get_parser # noqa: E402 from aider.dump import dump # noqa: F401 # tree_sitter is throwing a FutureWarning warnings.simplefilter("ignore", category=FutureWarning) >>>>>>> REPLACE ``` --- aider/linter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aider/linter.py b/aider/linter.py index 7f0d13dac..ed323449f 100644 --- a/aider/linter.py +++ b/aider/linter.py @@ -6,14 +6,13 @@ import warnings from pathlib import Path from grep_ast import TreeContext, filename_to_lang +from tree_sitter_languages import get_parser # noqa: E402 from aider.dump import dump # noqa: F401 # tree_sitter is throwing a FutureWarning warnings.simplefilter("ignore", category=FutureWarning) -from tree_sitter_languages import get_parser # noqa: E402 - class Linter: def __init__(self, encoding="utf-8", root=None):