Skip to content

Disallow new init-only APIs via Copilot instructions#7641

Merged
Evangelink merged 3 commits intomainfrom
dev/ygerges/init
Mar 31, 2026
Merged

Disallow new init-only APIs via Copilot instructions#7641
Evangelink merged 3 commits intomainfrom
dev/ygerges/init

Conversation

@Youssef1313
Copy link
Copy Markdown
Member

Closes #7285. It's done simply via copilot instructions instead of writing a whole new analyzer project for this.

Copilot AI review requested due to automatic review settings March 31, 2026 15:12
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

Updates the repository’s GitHub Copilot contribution guidelines to prevent introducing new public APIs that use C# init accessors, addressing the enforcement need described in issue #7285 without adding a dedicated analyzer project.

Changes:

  • Add a new “Public API guidelines” section disallowing init accessors in new public APIs (with a stated exception for existing Microsoft.Testing.Platform APIs).

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 31, 2026 15:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@Evangelink Evangelink merged commit 9ca3c41 into main Mar 31, 2026
3 checks passed
@Evangelink Evangelink deleted the dev/ygerges/init branch March 31, 2026 15:31
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.

Add internal analyzer to avoid init in public APIs

3 participants