mirror of
https://github.com/EbookFoundation/free-programming-books.git
synced 2026-07-08 05:11:57 +00:00
Merge 6bf42edf13a9f4d26df5886ed295a5f026c74e68 into a6afe576b653cb505c330cd960f4e858051aee51
This commit is contained in:
commit
19b042cdf4
@ -210,7 +210,8 @@ def lint_file(path, cfg):
|
||||
|
||||
# Try to read the file content and handle potential errors
|
||||
try:
|
||||
lines = open(path, encoding='utf-8').read().splitlines()
|
||||
with open(path, encoding='utf-8') as f:
|
||||
lines = f.read().splitlines()
|
||||
except Exception as e:
|
||||
return [f"::error file={path},line=1::Cannot read file: {e}"] # Return as a list of issues
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user