Skip to content

Commit 2a2ee97

Browse files
committed
Fix remaining ruff issues: format long lines, sort imports, remove unused imports
1 parent 48e70c5 commit 2a2ee97

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/mdtk/bookmarks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def convert_bookmarks(
6666

6767
def main():
6868
"""Command line interface."""
69-
parser = argparse.ArgumentParser(description="Convert Chrome bookmarks to markdown format")
69+
parser = argparse.ArgumentParser(
70+
description="Convert Chrome bookmarks to markdown format"
71+
)
7072
parser.add_argument("input_file", help="Chrome bookmarks HTML file")
7173
parser.add_argument("output_file", help="Output markdown file")
7274
parser.add_argument(

tests/test_bookmarks.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
from pathlib import Path
1+
"""Test suite for bookmarks conversion."""
2+
23
import pytest
3-
from mdtk.bookmarks import convert_bookmarks, BookmarkError
4+
5+
from mdtk.bookmarks import BookmarkError, convert_bookmarks
6+
47

58
@pytest.fixture
69
def test_bookmarks_file(tmp_path):
@@ -25,19 +28,21 @@ def test_bookmarks_file(tmp_path):
2528
test_file.write_text(bookmarks_content)
2629
return test_file
2730

31+
2832
def test_basic_conversion(test_bookmarks_file, tmp_path):
29-
"""Test basic bookmark conversion with default folder"""
33+
"""Test basic bookmark conversion with default folder."""
3034
test_md = tmp_path / "output.md"
3135

3236
convert_bookmarks(test_bookmarks_file, test_md)
3337

34-
content = test_md.read_text().strip().split('\n')
38+
content = test_md.read_text().strip().split("\n")
3539
assert len(content) == 2
36-
assert '- [GitHub - Where the world builds software](https://github.com)' in content
37-
assert '- [Welcome to Python.org](https://python.org)' in content
40+
assert "- [GitHub - Where the world builds software](https://github.com)" in content
41+
assert "- [Welcome to Python.org](https://python.org)" in content
42+
3843

3944
def test_nonexistent_folder(test_bookmarks_file, tmp_path):
40-
"""Test error handling for non-existent folder"""
45+
"""Test error handling for non-existent folder."""
4146
test_md = tmp_path / "output.md"
4247

4348
with pytest.raises(BookmarkError, match="Folder 'NonExistent' not found"):

0 commit comments

Comments
 (0)