Skip to content

Conversation

vmaerten
Copy link
Member

@vmaerten vmaerten commented May 3, 2025

Summary

The wildcard did not match aliases.
I've done a bit of refactoring and moved some code into FindMatchingTasks, but its signature has changed. Is it OK for the package API, or should I consider another solution ?
The goal was for FindMatchingTasks to also handle matching aliases (even without wildcards). It felt more logical to group all the task-matching logic in one place.

Fixes #1900

NOTE: I modified the test, but I did not migrate it to the new system yett

@vmaerten vmaerten marked this pull request as ready for review May 3, 2025 09:20
@vmaerten vmaerten requested review from andreynering, pd93 and Copilot and removed request for andreynering May 3, 2025 09:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for wildcard matching of task aliases by refactoring task-matching logic into a single function, FindMatchingTasks, and updating related components.

  • Updated task definitions in Taskfile.yml to include alias patterns
  • Modified WildcardMatch in taskfile/ast/task.go to iterate over both task names and aliases
  • Adjusted FindMatchingTasks and GetTask in task.go to handle conflicts when matching aliases

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
testdata/wildcards/Taskfile.yml Added alias definitions to support wildcard alias matching
taskfile/ast/task.go Updated WildcardMatch to check both task names and aliases in one loop
task_test.go Added test case to verify alias based matching
task.go Refactored FindMatchingTasks and GetTask to return conflict errors for multiple alias matches
Files not reviewed (1)
  • website/docs/usage.mdx: Language not supported

@vmaerten vmaerten added area: ui Changes related to the UI of Task. area: wildcards Changes related to wildcard matching labels May 3, 2025
@vmaerten vmaerten self-assigned this May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui Changes related to the UI of Task. area: wildcards Changes related to wildcard matching
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support wildcards in task aliases
1 participant