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

RS0030: Support banning attribute constructors #6772

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

mpidash
Copy link
Contributor

@mpidash mpidash commented Jul 15, 2023

This PR changes the way the analyzer for RS0030 decides when attributes should be analyzed. It now also checks the ContainerName, because the SymbolName contains .ctor when trying to ban an attribute constructor.
Additionally, the symbol check is modified to allow method symbols that are constructors.

AnalyzeAttributes now also calls VerifySymbol for attribute constructors.

Fixes #6524

@mpidash mpidash requested a review from a team as a code owner July 15, 2023 13:32
@codecov
Copy link

codecov bot commented Jul 15, 2023

Codecov Report

Merging #6772 (7c11bfa) into main (45879f0) will increase coverage by 0.00%.
The diff coverage is 96.15%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6772   +/-   ##
=======================================
  Coverage   96.33%   96.33%           
=======================================
  Files        1386     1386           
  Lines      325659   325736   +77     
  Branches    10718    10719    +1     
=======================================
+ Hits       313732   313812   +80     
+ Misses       9215     9213    -2     
+ Partials     2712     2711    -1     

@mavasani mavasani merged commit adcbeee into dotnet:main Jul 17, 2023
@mpidash mpidash deleted the issue-6524 branch July 17, 2023 17:23
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.

Ban of Attribute Constructor Not Enforced on Attribute Declarations
2 participants