Skip to content

Commit 3f4e0e1

Browse files
fix linting
1 parent 6a44709 commit 3f4e0e1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

codeflash/lsp/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import re
33
from functools import lru_cache
4+
from pathlib import Path
45

56
from rich.tree import Tree
67

@@ -48,8 +49,8 @@ def report_to_markdown_table(report: dict[TestType, dict[str, int]], title: str)
4849
def simplify_worktree_paths(msg: str, highlight: bool = True) -> str: # noqa: FBT001, FBT002
4950
path_in_msg = worktree_path_regex.search(msg)
5051
if path_in_msg:
51-
# Use os.path.basename to handle both Unix and Windows path separators
52-
last_part_of_path = os.path.basename(path_in_msg.group(0))
52+
# Use Path.name to handle both Unix and Windows path separators
53+
last_part_of_path = Path(path_in_msg.group(0)).name
5354
if highlight:
5455
last_part_of_path = f"`{last_part_of_path}`"
5556
return msg.replace(path_in_msg.group(0), last_part_of_path)

0 commit comments

Comments
 (0)