Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide analyzer for removing unneeded public partial class Program #58482

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

captainsafia
Copy link
Member

@captainsafia captainsafia commented Oct 17, 2024

Follow-up to #58199.

Based on the code generation that we introduced earlier, users can get rid of the explicit public partial class Program { } declarations in their source code and rely on the new default behavior.

This PR introduces an analyzer to find these explicit declarations and a code fixer to remove them.

Implements #58488

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Oct 17, 2024
@captainsafia captainsafia added analyzer Indicates an issue which is related to analyzer experience feature-mvc-testing MVC testing package area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Oct 17, 2024
Copy link
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

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

:shipit:

@captainsafia captainsafia marked this pull request as ready for review October 17, 2024 19:26
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Oct 25, 2024
@captainsafia captainsafia removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Oct 28, 2024
@captainsafia captainsafia enabled auto-merge (squash) October 30, 2024 22:18
@captainsafia captainsafia merged commit 95a8ea7 into main Oct 31, 2024
27 checks passed
@captainsafia captainsafia deleted the public-api-analyzer branch October 31, 2024 18:06
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Oct 31, 2024
captainsafia added a commit that referenced this pull request Feb 11, 2025
…58482)

* Provide analyzer for removing unneeded public partial class Program

* Update tests and fix async call

* Address feedback

* Add test for public partial class with members

* Reorganize checks and add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer Indicates an issue which is related to analyzer experience area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-mvc-testing MVC testing package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants