Repository navigation
Promote typed parameter diagnostics to warnings - #14706
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates the MSBuild TaskAnalyzer to surface the typed-parameter modernization diagnostics (MSBuildTask0006–MSBuildTask0008) as warnings instead of info, so they’re visible in typical build outputs and IDE diagnostic views when the analyzer is enabled. It also updates the Tasks project’s analyzer build configuration so these new warnings won’t break /warnaserror builds while existing issues are being addressed.
Changes:
- Promote MSBuildTask0006–MSBuildTask0008 default severities from
InfotoWarningin the analyzer descriptors. - Update analyzer docs/release notes to reflect the new severities.
- Extend Tasks project
WarningsNotAsErrors(underBuildAnalyzer=true) and update tests to assert warning severity.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tasks/Microsoft.Build.Tasks.csproj | Adds MSBuildTask0006–0008 to WarningsNotAsErrors when BuildAnalyzer=true to prevent /warnaserror builds from failing while still emitting warnings. |
| src/TaskAnalyzer/README.md | Updates the documented severities and severity-level explanation for MSBuildTask0006–0008. |
| src/TaskAnalyzer/DiagnosticDescriptors.cs | Changes the default severity of MSBuildTask0006–0008 descriptors to Warning. |
| src/TaskAnalyzer/AnalyzerReleases.Unshipped.md | Updates the unshipped rules table to reflect Warning severity for MSBuildTask0006–0008. |
| src/TaskAnalyzer.Tests/PreferTypedParameterAnalyzerTests.cs | Adds assertions that emitted diagnostics for 0006/0007/0008 are Warning. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Expert Review — PR #14706: Promote typed parameter diagnostics to warnings
✅ 24/24 dimensions clean — no findings.
Summary: This PR promotes MSBuildTask0006, MSBuildTask0007, and MSBuildTask0008 from Info to Warning severity in the TaskAnalyzer NuGet package. The change is well-scoped and correctly mitigated:
- Backward compatibility: Since
AnalyzerReleases.Shipped.mdshows no shipped releases yet, there are no existing consumers to break. The diagnostics only fire for tasks explicitly marked with[MSBuildMultiThreadableTask](an opt-in attribute), limiting blast radius to task authors who have already adopted this annotation. - WarnAsError protection: The
WarningsNotAsErrorsaddition inMicrosoft.Build.Tasks.csprojcorrectly protects the Tasks project CI during the transition period. - Test coverage: All three promoted diagnostics (0006, 0007, 0008) have new
Severity.ShouldBe(Warning)assertions. - Documentation:
README.mdandAnalyzerReleases.Unshipped.mdare both updated consistently.
Generated by Expert Code Review (on open) for #14706 · sonnet46 · 59.4 AIC · ⌖ 7.62 AIC · ⊞ 5.3K
Summary
Promotes MSBuildTask0006-MSBuildTask0008 from Info to Warning so they appear in CLI builds and Visual Studio without extra configuration.