aider: Fix import sorting in aider/linter.py to resolve isort failure.

# 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
```
This commit is contained in:
Paul Gauthier 2024-05-18 18:59:39 -07:00
parent 5959e7990a
commit e516f838f5

View file

@ -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):