Skip to content

Generic NamedCheckOps so non-Unit tasks can use .named - #375

Merged
alejandrohdezma merged 2 commits into
mainfrom
fix/generic-named-check-ops
May 19, 2026
Merged

Generic NamedCheckOps so non-Unit tasks can use .named#375
alejandrohdezma merged 2 commits into
mainfrom
fix/generic-named-check-ops

Conversation

@alejandrohdezma

@alejandrohdezma alejandrohdezma commented May 19, 2026

Copy link
Copy Markdown
Owner

💻 How to review this PR?

This PR was created with the idea of being reviewed commit by commit. Each commit contains an incremental change that makes it easier to review. Also some of the commits contain additional information in their description to help understand why the change was made.

I also recommend checking "Hide whitespace" when reviewing this PR!

🚀 What's included in this PR?

NamedCheckOps was pinned to Def.Initialize[Task[Unit]], so bare task keys whose result type isn't Unit (sbt's compile: TaskKey[CompileAnalysis], doc: TaskKey[File], etc.) couldn't be wrapped into fixCheckExtra — the build failed to load with value named is not a member of sbt.TaskKey[...].

This PR:

  • Re-introduces the [A] type parameter on NamedCheckOps so any Def.Initialize[Task[A]] picks up .named / .acrossAggregated.
  • Discards the result inside .named via task.map(_ => ()), preserving NamedCheck.task: Def.Initialize[Task[Unit]] (the orchestrator only cares whether a check succeeded).
  • Bumps versionPolicyIntention to Compatibility.None for this release, since adding the type parameter is a binary-incompatible signature change.
  • No README change needed — the documented usage (someTask.named("…")) is unchanged from the user's perspective; it just starts working for more someTask types.

`NamedCheckOps` was pinned to `Def.Initialize[Task[Unit]]`, so wrapping bare task keys whose result type isn't `Unit` (e.g. `compile: TaskKey[CompileAnalysis]`, `doc: TaskKey[File]`) into `fixCheckExtra` failed with `value named is not a member of sbt.TaskKey[...]`. Re-introduce the `[A]` type parameter and have `.named` discard the result via `task.map(_ => ())` so any task initializer can be turned into a `NamedCheck`.
@github-actions github-actions Bot added 🪲 bug Bug fixes ⚖️ XS Size of PR between 10 and 50 lines labels May 19, 2026
@alejandrohdezma
alejandrohdezma merged commit 38c4221 into main May 19, 2026
6 checks passed
@alejandrohdezma
alejandrohdezma deleted the fix/generic-named-check-ops branch May 19, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚖️ XS Size of PR between 10 and 50 lines 🪲 bug Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant