-
Notifications
You must be signed in to change notification settings - Fork 470
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
Do not warn on zero-length allocations in unspecified params parameters in attributes #6114
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7768502
Do not warn on zero-length allocations in unspecified params paramete…
333fred 2746555
Address more test failures from the compiler upgrade.
333fred 2f87fb8
Update CodeMetrics to handle OperationKind.Attribute
mavasani 0b7f443
Fix tests for RegisterActionAnalyzer
mavasani 977ec05
Gracefully bail out of flow analysis for OperationKind.Attribute
mavasani 74a797d
Fix typo
mavasani 931e02d
Merge branch 'main' into fix-zerolength
333fred f8a3c83
Skip flaky tests.
333fred File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params
parameters have the attribute itself as their syntax.Note: we could potentially check for an
IAttributeOperation
itself, but I'm not familiar with the process for updating the reference used by the analyzer itself so it would know about that type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you wanted to go this route, new operations goes into Lightup layer, e.g:
roslyn-analyzers/src/Utilities/Compiler/Lightup/OperationKindEx.cs
Line 11 in 793113a
roslyn-analyzers/src/Utilities/Compiler/Lightup/IUsingDeclarationOperationWrapper.cs
Line 13 in 793113a
We can't yet update the product code to consume latest Roslyn versions.
Then, to consume a Roslyn version in tests that have
IAttributeOperation
, we update the following:roslyn-analyzers/eng/Versions.props
Line 48 in 793113a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would have to leave this check in the code anyway, so I don't think it's worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity is that all params parameters or just ones that are zero-length like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the implicit ones. It matches the behavior for use in non-attribute locations (ie, just a regular invocation).