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

Don't raise CA1861 in for attribute arguments #7044

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

CollinAlpert
Copy link
Contributor

This PR modifies the AvoidConstArraysAnalyzer to not raise for attribute arguments.

Is there any possibility to use the IAttributeOperation API? Otherwise I am stuck using the current workaround to check for an attribute.

Fixes #7033

@CollinAlpert CollinAlpert requested a review from a team as a code owner November 19, 2023 12:20
Copy link

codecov bot commented Nov 19, 2023

Codecov Report

Merging #7044 (2166899) into main (b924542) will increase coverage by 0.00%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7044   +/-   ##
=======================================
  Coverage   96.43%   96.43%           
=======================================
  Files        1412     1412           
  Lines      336522   336577   +55     
  Branches    11119    11119           
=======================================
+ Hits       324513   324576   +63     
+ Misses       9207     9200    -7     
+ Partials     2802     2801    -1     

@mavasani
Copy link
Contributor

Is there any possibility to use the IAttributeOperation API? Otherwise I am stuck using the current workaround to check for an attribute.

Feel free to use lightup for now and a tracking issue + comment to remove the added lightup code. Not sure if we want to move all the way to the MS.CA API that added IAttributeOperation support and prevent analyzers from running on older VS/compiler.

@mavasani
Copy link
Contributor

@CollinAlpert IMO your current fix looks good to me without having to switch to IAttributeOperation. Let me know if you are fine for me to merge or want to attempt adding lightup for IAttributeOperation

@CollinAlpert
Copy link
Contributor Author

I see. I am fine with merging, adding lightup would be too much unnecessary effort IMO.

@mavasani mavasani merged commit 1a7c304 into dotnet:main Nov 30, 2023
14 checks passed
@CollinAlpert CollinAlpert deleted the issue-7033 branch November 30, 2023 13:41
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.

CA1861 false positive in method attribute
2 participants