Skip to content

Commit

Permalink
fix: Fix logic for trailing newline check
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmo00 committed Jan 29, 2024
1 parent 03a8856 commit 3e77b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alxcheck/checks/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def check_file_ends_with_new_line(file_path):
if not check_file_not_empty(file_path):
return False

with open(file_path, "rb") as f:
return f.readlines()[-1] == b"\n"
with open(file_path, "r") as f:
return f.readlines()[-1][-1] == "\n"

0 comments on commit 3e77b45

Please sign in to comment.