Skip to content

fix: reject include without taskfile or dir#2892

Merged
vmaerten merged 2 commits into
go-task:mainfrom
Lewin671:fix/include-missing-taskfile-error
Jul 1, 2026
Merged

fix: reject include without taskfile or dir#2892
vmaerten merged 2 commits into
go-task:mainfrom
Lewin671:fix/include-missing-taskfile-error

Conversation

@Lewin671

Copy link
Copy Markdown
Contributor

Fixes #1881.

What changed

  • Reject advanced include mappings that specify neither taskfile nor dir.
  • Add a regression test for the malformed include case from the issue.
  • Assert the old misleading include-cycle error is no longer returned.

Why

A mapping under includes: without a Taskfile path currently falls through to default Taskfile discovery. In the issue example, that makes a simple configuration mistake look like an include cycle. Failing during Taskfile decoding gives the user a direct configuration error instead.

Validation

  • go test ./...
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run

@Lewin671 Lewin671 marked this pull request as ready for review June 26, 2026 17:00
@vmaerten vmaerten self-requested a review July 1, 2026 19:44

@vmaerten vmaerten left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks ! I've added the schema validation as well

@vmaerten vmaerten enabled auto-merge (squash) July 1, 2026 19:48
@vmaerten vmaerten merged commit b5861b1 into go-task:main Jul 1, 2026
14 checks passed
vmaerten added a commit that referenced this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect/confusing include cycle detected error message after a silly mistake

2 participants