mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +00:00
aider: Add LintResult class to linter.py.
# Aider chat conversation: USER: create LinkResult ASSISTANT: To create the `LintResult` class, we need to add it to the `aider/linter.py` file. Here is the *SEARCH/REPLACE* block to add the `LintResult` class: aider/linter.py ```python <<<<<<< SEARCH from pathlib import Path ======= from pathlib import Path from dataclasses import dataclass >>>>>>> REPLACE ``` aider/linter.py ```python <<<<<<< SEARCH def lint_python_compile(fname, code): ======= @dataclass class LintResult: text: str lines: list def lint_python_compile(fname, code): >>>>>>> REPLACE ```
This commit is contained in:
parent
24e98a4ac2
commit
84edf3039c
1 changed files with 7 additions and 0 deletions
|
@ -4,6 +4,7 @@ import sys
|
||||||
import traceback
|
import traceback
|
||||||
import warnings
|
import warnings
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from grep_ast import TreeContext, filename_to_lang
|
from grep_ast import TreeContext, filename_to_lang
|
||||||
from tree_sitter_languages import get_parser # noqa: E402
|
from tree_sitter_languages import get_parser # noqa: E402
|
||||||
|
@ -105,6 +106,12 @@ class Linter:
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class LintResult:
|
||||||
|
text: str
|
||||||
|
lines: list
|
||||||
|
|
||||||
|
|
||||||
def lint_python_compile(fname, code):
|
def lint_python_compile(fname, code):
|
||||||
try:
|
try:
|
||||||
compile(code, fname, "exec") # USE TRACEBACK BELOW HERE
|
compile(code, fname, "exec") # USE TRACEBACK BELOW HERE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue