mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 03:35:00 +00:00
fix: Handle file read errors in linter
This commit is contained in:
parent
3a96a10d06
commit
212e22b2b7
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,11 @@ 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 OSError as err:
|
||||||
|
print(f"Unable to read {fname}: {err}")
|
||||||
|
return
|
||||||
|
|
||||||
if cmd:
|
if cmd:
|
||||||
cmd = cmd.strip()
|
cmd = cmd.strip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue