Skip to content

Commit 01c5588

Browse files
fix: standardize string formatting in path audit workflow and improve comments in migration suggestions
1 parent 467f145 commit 01c5588

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/workflows/path-audit.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ name: Cross-Platform Path Handling Audit
33
on:
44
pull_request:
55
paths:
6-
- '**/*.py'
7-
- 'scripts/audit_paths.py'
8-
- '.github/workflows/path-audit.yml'
6+
- "**/*.py"
7+
- "scripts/audit_paths.py"
8+
- ".github/workflows/path-audit.yml"
99
push:
1010
branches:
1111
- main
1212
paths:
13-
- '**/*.py'
14-
- 'scripts/audit_paths.py'
15-
- '.github/workflows/path-audit.yml'
13+
- "**/*.py"
14+
- "scripts/audit_paths.py"
15+
- ".github/workflows/path-audit.yml"
1616

1717
jobs:
1818
path-audit:

scripts/audit_paths.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def generate_migration_suggestions(issues: dict[str, list[dict[str, Any]]]) -> s
117117
suggestions.append("# Suggested fix:")
118118
suggestions.append("from libp2p.utils.paths import join_paths")
119119
suggestions.append(
120-
"# Replace os.path.join(a, b, c) with join_paths(a, b, c)"
120+
"# Replace os.path.join with join_paths function"
121121
)
122122
suggestions.append("```")
123123
elif issue_type == "temp_hardcode":
@@ -137,8 +137,7 @@ def generate_migration_suggestions(issues: dict[str, list[dict[str, Any]]]) -> s
137137
suggestions.append("# Suggested fix:")
138138
suggestions.append("from libp2p.utils.paths import get_script_dir")
139139
script_dir_fix_msg = (
140-
"# Replace os.path.dirname(os.path.abspath(__file__)) with "
141-
"get_script_dir(__file__)"
140+
"# Replace dirname and abspath with get_script_dir function"
142141
)
143142
suggestions.append(script_dir_fix_msg)
144143
suggestions.append("```")

tests/core/kad_dht/test_unit_provider_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,8 @@ def test_unicode_key_handling(self):
725725

726726
for i, key in enumerate(unicode_keys):
727727
# Generate valid Base58 peer IDs
728-
peer_id = ID.from_base58(f"QmPeer{i + 1}" + "1" * 42) # Valid base58
728+
peer_id_str = f"QmPeer{i + 1}{'1' * 42}" # Valid base58
729+
peer_id = ID.from_base58(peer_id_str)
729730
provider = PeerInfo(peer_id, [])
730731
store.add_provider(key, provider)
731732

0 commit comments

Comments
 (0)