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

Emit CA1822 for recursive method. #6641

Merged
merged 3 commits into from
May 25, 2023
Merged

Conversation

CollinAlpert
Copy link
Contributor

The MarkMembersAsStaticAnalyzer currently checks if a method contains any instance reference operations. This PR adds an exclusion of the method itself, i.e. a recursive method, to that check.

Fixes #6540

@CollinAlpert CollinAlpert requested a review from a team as a code owner May 19, 2023 18:38
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Merging #6641 (e366cee) into main (3515b06) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head e366cee differs from pull request most recent head cbb0151. Consider uploading reports for the commit cbb0151 to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #6641    +/-   ##
========================================
  Coverage   96.40%   96.40%            
========================================
  Files        1379     1377     -2     
  Lines      322186   322045   -141     
  Branches    10459    10434    -25     
========================================
- Hits       310592   310472   -120     
+ Misses       9102     9083    -19     
+ Partials     2492     2490     -2     

Copy link
Member

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @CollinAlpert!

@buyaa-n buyaa-n enabled auto-merge (squash) May 25, 2023 23:34
@buyaa-n buyaa-n merged commit 2b6ab8d into dotnet:main May 25, 2023
@github-actions github-actions bot added this to the vNext milestone May 25, 2023
@CollinAlpert CollinAlpert deleted the issue_6540 branch May 26, 2023 06: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.

The advice 'mark static' will not work on the method is a recursive method
2 participants