mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
refactor: simplify file reading in Linter.lint method
This commit is contained in:
parent
91cd9d6b51
commit
301c4265b7
1 changed files with 1 additions and 5 deletions
|
@ -76,11 +76,7 @@ class Linter:
|
||||||
|
|
||||||
def lint(self, fname, cmd=None):
|
def lint(self, fname, cmd=None):
|
||||||
rel_fname = self.get_rel_fname(fname)
|
rel_fname = self.get_rel_fname(fname)
|
||||||
try:
|
code = Path(fname).read_text(encoding=self.encoding, errors="replace")
|
||||||
code = Path(fname).read_text(encoding=self.encoding, errors="replace")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error reading file {fname}: {str(e)}")
|
|
||||||
return
|
|
||||||
|
|
||||||
if cmd:
|
if cmd:
|
||||||
cmd = cmd.strip()
|
cmd = cmd.strip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue