Skip to content

Add CA2266 analyzer documentation#53992

Open
Copilot wants to merge 16 commits into
mainfrom
copilot/add-docs-for-ca2266
Open

Add CA2266 analyzer documentation#53992
Copilot wants to merge 16 commits into
mainfrom
copilot/add-docs-for-ca2266

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

Related to dotnet/sdk#53749 (comment).


CA2266 was introduced for file-based apps, but the docs set did not include a rule page or links from the analyzer indexes. This change adds the missing rule documentation and wires it into the relevant .NET 10 and code analysis entry points.

  • New rule article

    • Adds CA2266: File-based program entry point should start with '#!'
    • Documents the rule cause, guidance, suppression details, and related file-based app docs
  • Analyzer index updates

    • Adds CA2266 to the usage warnings index
    • Adds CA2266 to the main quality rules index
    • Adds CA2266 to the code analysis overview table for .NET 10
  • Navigation and discovery

    • Adds CA2266 to the tools diagnostics TOC
    • Links the rule from the .NET 10 SDK “file-based apps” content so the analyzer is discoverable from the feature docs
  • Example

    // app.cs
    #:include "helpers.cs"
    
    Console.WriteLine(GetMessage());
    // app.cs
    #!/usr/bin/env dotnet
    #:include "helpers.cs"
    
    Console.WriteLine(GetMessage());

Internal previews

📄 File 🔗 Preview link
docs/fundamentals/code-analysis/overview.md docs/fundamentals/code-analysis/overview
docs/fundamentals/code-analysis/quality-rules/ca2266.md docs/fundamentals/code-analysis/quality-rules/ca2266
docs/fundamentals/code-analysis/quality-rules/index.md docs/fundamentals/code-analysis/quality-rules/index
docs/fundamentals/code-analysis/quality-rules/usage-warnings.md docs/fundamentals/code-analysis/quality-rules/usage-warnings
docs/navigate/tools-diagnostics/toc.yml docs/navigate/tools-diagnostics/toc

Copilot AI self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 14:30
Copilot AI review requested due to automatic review settings May 21, 2026 14:30
@jjonescz jjonescz requested a review from Copilot May 21, 2026 14:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation for the new CA2266 analyzer rule (file-based apps shebang requirement) and connects the new rule page to the existing code analysis indexes, TOC navigation, and .NET 10 SDK “file-based apps” content so users can discover it.

Changes:

  • Adds a new rule article for CA2266 under code quality rules.
  • Updates rule indexes and the .NET 10 “enabled rules” table to include CA2266.
  • Adds CA2266 to the tools diagnostics TOC and links to it from the .NET 10 SDK file-based apps section.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/navigate/tools-diagnostics/toc.yml Adds CA2266 to the Code quality → Usage rules navigation.
docs/fundamentals/code-analysis/quality-rules/usage-warnings.md Adds CA2266 to the Usage rules index table.
docs/fundamentals/code-analysis/quality-rules/index.md Adds CA2266 to the main quality rules index table.
docs/fundamentals/code-analysis/quality-rules/ca2266.md New CA2266 rule documentation page (cause, guidance, suppression, and example).
docs/fundamentals/code-analysis/overview.md Adds CA2266 to the .NET 10 enabled-by-default rules table.
docs/core/whats-new/dotnet-10/sdk.md Links CA2266 from the .NET 10 file-based apps enhancements section.

Comment thread docs/fundamentals/code-analysis/quality-rules/ca2266.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread docs/core/whats-new/dotnet-10/sdk.md Outdated
Copy link
Copy Markdown
Member

@jjonescz jjonescz left a comment

Choose a reason for hiding this comment

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

Comment thread docs/fundamentals/code-analysis/quality-rules/ca2266.md Outdated
Comment thread docs/fundamentals/code-analysis/quality-rules/ca2266.md Outdated
Copilot AI requested a review from jjonescz May 21, 2026 15:02
Comment thread docs/fundamentals/code-analysis/quality-rules/ca2266.md Outdated
Comment thread docs/fundamentals/code-analysis/quality-rules/ca2266.md Outdated
@jjonescz jjonescz marked this pull request as ready for review May 22, 2026 09:07
@jjonescz jjonescz requested review from a team and gewarren as code owners May 22, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants