Unused import in fs.py #29

Open
opened 2025-11-15 03:44:26 +00:00 by snegov · 0 comments
Owner

Unused import in fs.py

Priority: Very Low
Component: fs.py
Type: Code Quality

Description

The glob module is imported but only used in one function, and could be replaced with built-in functionality.

Location

curateipsum/fs.py:6

Current Code

import glob  # Line 6

# Only used here:
def _recursive_hardlink_ext(src: str, dst: str) -> bool:
    ...
    src_content = glob.glob(f"{src}/*")  # Line 425
    ...

Problem

Minor code quality issue - importing module at top level for single use.

Proposed Solution

Replace with os.listdir():

src_content = [os.path.join(src, f) for f in os.listdir(src)]

Or keep import if preferred, but note it in a comment.

Impact

Very Low - Minor code cleanliness issue.

# Unused import in fs.py **Priority:** Very Low **Component:** fs.py **Type:** Code Quality ## Description The `glob` module is imported but only used in one function, and could be replaced with built-in functionality. ## Location `curateipsum/fs.py:6` ## Current Code ```python import glob # Line 6 # Only used here: def _recursive_hardlink_ext(src: str, dst: str) -> bool: ... src_content = glob.glob(f"{src}/*") # Line 425 ... ``` ## Problem Minor code quality issue - importing module at top level for single use. ## Proposed Solution Replace with `os.listdir()`: ```python src_content = [os.path.join(src, f) for f in os.listdir(src)] ``` Or keep import if preferred, but note it in a comment. ## Impact **Very Low** - Minor code cleanliness issue.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: snegov/cura-te-ipsum#29
No description provided.