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

SealInternalTypes (CA1852): Don't warn for top-level type #6278

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

Youssef1313
Copy link
Member

Fixes #6141

@Youssef1313 Youssef1313 requested a review from a team as a code owner November 17, 2022 15:26
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks!

@Youssef1313
Copy link
Member Author

@mavasani @stephentoub Is this ready to merge?

It would be good to have this merged before the stable release (#6285)

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #6278 (47694fc) into main (c5aa7bf) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6278   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files        1364     1364           
  Lines      313686   313698   +12     
  Branches    10125    10125           
=======================================
+ Hits       301322   301337   +15     
+ Misses       9943     9941    -2     
+ Partials     2421     2420    -1     

@stephentoub stephentoub merged commit e439524 into dotnet:main Nov 23, 2022
@github-actions github-actions bot added this to the vNext milestone Nov 23, 2022
@Youssef1313 Youssef1313 deleted the patch-19 branch November 23, 2022 13:38
amis92 added a commit to BSData/gallery-dashboard that referenced this pull request Feb 2, 2023
This rule is currently being incorrectly applied to the generated
`Program` class [1] and therefore has to be suppressed manually.

A fix [2] has already been committed to the Roslyn Analyzers repo once
that fix has been included in a future SDK update.

[1] dotnet/roslyn-analyzers#6141
[2] dotnet/roslyn-analyzers#6278
jhartmann123 pushed a commit to jhartmann123/roslyn-analyzers that referenced this pull request Feb 22, 2023
* SealInternalTypes (CA1852): Don't warn for top-level type

* Fix build errors
smfeest added a commit to smfeest/buttercup that referenced this pull request Mar 5, 2023
As mentioned in the previous commit, .NET 7 includes a new analyzer [1]
that checks for internal types that can be sealed.

Unfortunately that analyzer is currently generating false positives for
generated `Program` classes [2] and therefore has to be suppressed
manually.

A fix [3] has already been committed to the Roslyn Analyzers repo so we
should be able to remove this suppression once that fix has made its way
into an SDK update.

[1] dotnet/roslyn-analyzers#5594
[2] dotnet/roslyn-analyzers#6141
[3] dotnet/roslyn-analyzers#6278
buyaa-n pushed a commit that referenced this pull request Mar 10, 2023
)

* SealInternalTypes (CA1852): Don't warn for top-level type

* Fix build errors

Co-authored-by: Youssef Victor <[email protected]>
smfeest added a commit to smfeest/buttercup that referenced this pull request Nov 19, 2023
The bug [1] that made adding this suppression [2] necessary has been
fixed [3] in .NET 8.

[1] dotnet/roslyn-analyzers#6141
[2] 5a4dc3d
[3] dotnet/roslyn-analyzers#6278
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.

CA1852 warns on generated Program for top-level statements
2 participants