Skip to content

Commit c31eb47

Browse files
minhdqdevCopilot
andcommitted
fix: case-insensitive project matching in add command
#project tags like #dsta now correctly match projects named 'DSTA'. difflib.get_close_matches was comparing case-sensitively, causing 'dsta' to have 0.0 similarity against 'DSTA' and not be assigned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5ba2f96 commit c31eb47

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/todopro_cli/commands/add_command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,12 @@ async def _do_create():
235235
project_service = ProjectService(project_repo)
236236
all_projects = await project_service.list_projects()
237237
names = [p.name for p in all_projects]
238+
parsed_lower = parsed["project_name"].lower()
238239
matches = difflib.get_close_matches(
239-
parsed["project_name"], names, n=1, cutoff=0.6
240+
parsed_lower, [n.lower() for n in names], n=1, cutoff=0.6
240241
)
241242
if matches:
242-
proj = next(p for p in all_projects if p.name == matches[0])
243+
proj = next(p for p in all_projects if p.name.lower() == matches[0])
243244
project_id = proj.id
244245
effective_project_name = proj.name
245246
else:

0 commit comments

Comments
 (0)