From 769a31b7e32ebed0e51609b4209e0506b3634be0 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 1 Dec 2024 07:22:40 -0800 Subject: [PATCH] refactor: remove redundant encoding parameter from FileWatcher --- aider/watch.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/aider/watch.py b/aider/watch.py index cb42ad997..211a0edb0 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -63,10 +63,9 @@ def load_gitignores(gitignore_paths: list[Path]) -> Optional[PathSpec]: class FileWatcher: """Watches source files for changes and AI comments""" - def __init__(self, coder, encoding="utf-8", gitignores=None, verbose=False): + def __init__(self, coder, gitignores=None, verbose=False): self.coder = coder self.io = coder.io - self.encoding = encoding self.root = Path(coder.root) self.verbose = verbose # or True self.stop_event = None @@ -133,7 +132,7 @@ class FileWatcher: changed_files = {str(Path(change[1])) for change in changes} result = {} for file in changed_files: - if comments := self.get_ai_comment(file, encoding=self.encoding): + if comments := self.get_ai_comment(file): result[file] = comments self.changed_files.update(result) @@ -196,7 +195,7 @@ class FileWatcher: dump(res) return res - def get_ai_comment(self, filepath, encoding="utf-8"): + def get_ai_comment(self, filepath): """Extract all AI comments from a file""" comments = [] try: