Skip to content

Allow cref in MA0197 inheritdoc checks#1142

Merged
meziantou merged 8 commits into
mainfrom
meziantou/allow-cref-inheritdoc
May 8, 2026
Merged

Allow cref in MA0197 inheritdoc checks#1142
meziantou merged 8 commits into
mainfrom
meziantou/allow-cref-inheritdoc

Conversation

@meziantou

Copy link
Copy Markdown
Owner

MA0197 currently flags <inheritdoc> on types even when a cref is provided, which prevents using explicit documentation inheritance targets on type declarations.

This update makes MA0197 consistent with that usage by skipping diagnostics when <inheritdoc> includes a cref attribute. The analyzer now handles both empty XML tags (<inheritdoc cref="..." />) and non-empty XML tags (<inheritdoc cref="..."></inheritdoc>). The rule tests were updated to assert the new behavior, and the MA0197 documentation now reflects that cref is allowed.

This branch also includes the existing dependency/tooling update commit already present on this branch (global.json SDK/MSBuild SDK updates and a Directory.Build.targets adjustment for nullable warning suppression scope).

meziantou and others added 8 commits May 8, 2026 13:37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Revert accidental SDK/MSBuild SDK updates and restore nullable warning settings for net462. Also split InheritdocShouldNotBeUsedOnTypesAnalyzerTests into a matching file to satisfy MA0048 and keep the new cref test coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meziantou meziantou enabled auto-merge (squash) May 8, 2026 18:20
@meziantou meziantou merged commit 5ce9a7e into main May 8, 2026
13 checks passed
@meziantou meziantou deleted the meziantou/allow-cref-inheritdoc branch May 8, 2026 18:21
This was referenced May 8, 2026
This was referenced Jun 11, 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.

1 participant