Skip to content

DOC-02: documentation states the supported .NET versions - #203

Merged
davidnmbond merged 1 commit into
mainfrom
feat/doc-02-supported-dotnet-docs
Nov 13, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
feat/doc-02-supported-dotnet-docs

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Adds rule DOC-02.

  • README.md must contain the set phrase, e.g. Supports .NET 11.0 (several versions: Supports .NET 8.0 and .NET 11.0), derived from the published projects' target frameworks.
  • README files, AGENTS/CLAUDE/CONTRIBUTING/SECURITY, copilot-instructions and published project Description/PackageDescription must not name any other .NET version, moniker, .NET Framework, .NET Standard or .NET Core version.
  • Changelogs, plans and publishing notes are deliberately out of scope: rewriting their version numbers would falsify history.
  • No automatic remediation here; a separate session is building one against the advisory data.

Verification: 13 new tests, SelfAssessment, FailArmy and RemediationRegistryExclusionTests pass (23/23). The estate was brought to 87 of 88 passing DOC-02 beforehand; this repo is the 88th and passes once this merges.

README.md must contain the set phrase (for example 'Supports .NET 11.0'), derived from the
published projects' target frameworks. README and instruction files and project descriptions
must not name any other .NET version. Changelogs and plans are exempt.

Also fetches copilot-instructions.md so it is checked, and updates this repo's own docs.
@codacy-production

codacy-production Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 high

View in Codacy

🟢 Metrics 46 complexity · 0 duplication

Metric Results
Complexity 46
Duplication 0

View in Codacy

🟢 Coverage 88.00% diff coverage · +0.16% coverage variation

Metric Results
Coverage variation ✅ +0.16% coverage variation (-1.00%)
Diff coverage ✅ 88.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (cdb0663) 22643 14388 63.54%
Head commit (65c798a) 22793 (+150) 14520 (+132) 63.70% (+0.16%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#203) 150 132 88.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit c97435f into main Nov 13, 2026
4 of 5 checks passed

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

⚠️ Resolve issues before merging

Several high-confidence gaps remain in the documentation rule: shared MSBuild properties are not fully resolved, inherited package descriptions can be skipped, and some unsupported framework spellings are not detected. The version-family switch also needs defensive handling to avoid silently misclassifying unexpected values.

Coverage is missing for remote instruction-file retrieval and several independently testable parsing branches, so these paths should be covered before merging.

About this PR

  • Add automated coverage for remote instruction-file retrieval and the independently testable framework-formatting and parser-exclusion branches.

Test suggestions

  • Pass when README contains the exact supported-version phrase.
  • Fail when README omits the required phrase.
  • Reject unsupported version mentions across current documentation files.
  • Reject unsupported versions in package Description or PackageDescription.
  • Require every framework when projects multi-target.
  • Inherit target frameworks from Directory.Build.props.
  • Ignore changelogs and plans while checking nested README files.
  • Remain not applicable when no published project exists.
  • Correctly parse and format .NET, Framework, Core, and Standard monikers.
  • Remote repository context fetches both copilot instruction file locations.
  • Resolve target framework and package description values inherited through shared MSBuild properties.
  • Handle unknown prose version families without misclassification.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Fail when README omits the required phrase.
2. Correctly parse and format .NET, Framework, Core, and Standard monikers.
3. Remote repository context fetches both copilot instruction file locations.
4. Resolve target framework and package description values inherited through shared MSBuild properties.
5. Handle unknown prose version families without misclassification.

TIP Add a Jira or Linear ticket key to the branch or title so the reviewer can check the PR against it. Using another tracker? Tell us.
TIP How was this review? Give us feedback

{
var number = match.Groups["version"].Value;
var kind = match.Groups["kind"].Value;
switch (kind)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Add a defensive default branch that rejects or otherwise safely handles unknown version families instead of silently classifying them as modern .NET versions.

See Issue in Codacy

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

}
}

[GeneratedRegex(@"\.NET\s+(?:(?<kind>Framework|Standard|Core)\s+)?(?<version>\d+(?:\.\d+)?)(?!\.\d)")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Recognize three-component framework versions and unqualified pre-.NET 5 versions, and add tests covering unsupported mentions such as these forms.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

var content = context.GetFileContent(project);
foreach (var property in new[] { "Description", "PackageDescription" })
{
foreach (var value in MsBuildProperties.TryGetValues(content, property) ?? [])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Check the effective package description, including values inherited from Directory.Build.props, so unsupported versions in shared package metadata are not missed. Add a regression test.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

Comment on lines +124 to +125
var monikers = TargetFrameworksOf(context.GetFileContent(project));
foreach (var moniker in monikers.Count > 0 ? monikers : inherited)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Resolve target framework property references, including values inherited from Directory.Build.props, before deriving supported versions. Add a regression test for a framework defined through a shared property.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

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