From ef286f0de63de092efb7a32912946fa7dcf01a3b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 18 May 2024 19:35:36 -0700 Subject: [PATCH] Refactored the Linter class to use a dynamic command for Python linting and added a placeholder function for finding filenames and line numbers in text. --- aider/linter.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/aider/linter.py b/aider/linter.py index 3a62fad72..c9d9de5ad 100644 --- a/aider/linter.py +++ b/aider/linter.py @@ -21,9 +21,10 @@ class Linter: py_cmd = f"flake8 --select={fatal} --show-source" # noqa: F841 self.languages = dict( - python=self.py_lint, - #python="/Users/gauthier/Projects/aider/tmp.sh" - #python="flake8 --show-source" + #python=self.py_lint, + #python="/Users/gauthier/Projects/aider/tmp.sh", + #python="flake8 --show-source", + python=py_cmd, ) def set_linter(self, lang, cmd): @@ -161,6 +162,11 @@ def traverse_tree(node): return errors +def find_filenames_and_linenums(text, fnames): + # TODO: + # search text for all occurrances of :\d+ and make a list of them + # where is one of the filenames in the list `fnames` + pass def main(): """