From 84edf3039c28387bd6a63a33bc6f79c70f1de6fc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 18 May 2024 20:44:07 -0700 Subject: [PATCH] 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 ``` --- aider/linter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aider/linter.py b/aider/linter.py index 71bef5c80..8fbfb76c7 100644 --- a/aider/linter.py +++ b/aider/linter.py @@ -4,6 +4,7 @@ import sys import traceback import warnings from pathlib import Path +from dataclasses import dataclass from grep_ast import TreeContext, filename_to_lang from tree_sitter_languages import get_parser # noqa: E402 @@ -105,6 +106,12 @@ class Linter: return result +@dataclass +class LintResult: + text: str + lines: list + + def lint_python_compile(fname, code): try: compile(code, fname, "exec") # USE TRACEBACK BELOW HERE