Skip to content

Commit 81beda6

Browse files
konardclaude
andcommitted
Fix Codacy static analysis issues
- Remove unused imports (re, pytest, Union, Tuple, Link) - Rename 'id' parameter to 'link_id' to avoid shadowing built-in - Remove unnecessary pass statement in ParseError class All 14 Codacy issues resolved while maintaining functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 18a3d83 commit 81beda6

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

python/platform_lino/link.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Link class representing a Lino link with optional ID and values.
33
"""
44

5-
from typing import List, Optional, Union
5+
from typing import List, Optional
66

77

88
class Link:
@@ -15,15 +15,15 @@ class Link:
1515
- A link with only values (no id)
1616
"""
1717

18-
def __init__(self, id: Optional[str] = None, values: Optional[List['Link']] = None):
18+
def __init__(self, link_id: Optional[str] = None, values: Optional[List['Link']] = None):
1919
"""
2020
Initialize a Link.
2121
2222
Args:
23-
id: Optional identifier for the link
23+
link_id: Optional identifier for the link
2424
values: Optional list of child links
2525
"""
26-
self.id = id
26+
self.id = link_id
2727
self.values = values if values is not None else []
2828
self._is_from_path_combination = False
2929

python/platform_lino/parser.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
converting text into structured Link objects.
66
"""
77

8-
import re
9-
from typing import List, Optional, Tuple, Dict, Any
8+
from typing import List, Optional, Dict, Any
109
from .link import Link
1110

1211

1312
class ParseError(Exception):
1413
"""Exception raised when parsing fails."""
15-
pass
1614

1715

1816
class Parser:

python/tests/test_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""API tests for Lino parser - ported from JS/Rust implementations."""
22

3-
import pytest
43
from platform_lino import Parser, Link
54

65

python/tests/test_single_line_parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Single-line parser tests - ported from JS implementation."""
22

3-
import pytest
4-
from platform_lino import Parser, Link, format_links
3+
from platform_lino import Parser, format_links
54

65

76
parser = Parser()

0 commit comments

Comments
 (0)