Skip to content

Commit

Permalink
fixed extra space in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdavis2 committed Apr 20, 2022
1 parent a02e31b commit 03b4d96
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions clean_ttl_hook/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
# removes unused namespace entries and re-serializes a graph with the prefixes in sorted order
def clean_ttl(input_file_path: Path):
# get a list of all leading comments in the file
input_file_path = Path(input_file_path)
comments_list = []
comment_flag = False
with open(input_file_path, "r", encoding="utf-8", errors="ignore") as f:
for index, line in enumerate(f):
if len(line.strip()) > 0 and line.strip()[0] == "#" and index == 0:
comments_list.append(line.strip()[1:])
comments_list.append(line.strip()[2:])
comment_flag = True

elif len(line.strip()) > 0 and line.strip()[0] == "#" and comment_flag:
comments_list.append(line.strip()[1:])
comments_list.append(line.strip()[2:])

elif len(line.strip()) > 0 and line.strip()[0] != "#":
comment_flag = False
Expand Down

0 comments on commit 03b4d96

Please sign in to comment.