refactor: simplify file reading in Linter.lint method

This commit is contained in:
Paul Gauthier 2024-08-29 19:21:41 -07:00 committed by Paul Gauthier (aider)
parent 91cd9d6b51
commit 301c4265b7

View file

@ -76,11 +76,7 @@ class Linter:
def lint(self, fname, cmd=None):
rel_fname = self.get_rel_fname(fname)
try:
code = Path(fname).read_text(encoding=self.encoding, errors="replace")
except Exception as e:
print(f"Error reading file {fname}: {str(e)}")
return
code = Path(fname).read_text(encoding=self.encoding, errors="replace")
if cmd:
cmd = cmd.strip()