Skip to content

Commit 3754394

Browse files
committed
Ruff formatting
1 parent 2399830 commit 3754394

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/link_sweep/markdown_parser.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Markdown file parsing utilities for link extraction and replacement."""
22

3-
from pathlib import Path
43
import re
4+
from pathlib import Path
55

66

77
def get_files(directory):
@@ -22,7 +22,7 @@ def get_md_links(md_file_path: list):
2222

2323
for file in md_file_path:
2424
try:
25-
with open(file, "r", encoding="utf-8") as md:
25+
with open(file, encoding="utf-8") as md:
2626
content = md.read()
2727
matches = re.findall(pattern, content)
2828
for text, url in matches:
@@ -37,7 +37,7 @@ def get_md_links(md_file_path: list):
3737
def replace_link(md_file_path, bad_links):
3838
"""Replace bad links with their text content in markdown files."""
3939
try:
40-
with open(md_file_path, "r", encoding="utf-8") as f:
40+
with open(md_file_path, encoding="utf-8") as f:
4141
content = f.read()
4242

4343
# Apply all replacements
@@ -54,4 +54,5 @@ def replace_link(md_file_path, bad_links):
5454

5555
except Exception as e:
5656
print(f"Error updating {md_file_path}: {e}")
57-
return False
57+
return False
58+

0 commit comments

Comments
 (0)