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

Improve S6640: Support type declarations #7486

Merged
merged 3 commits into from
Jun 21, 2023
Merged

Conversation

Tim-Pohlmann
Copy link
Contributor

Follow-up to #7290

Comment on lines +3 to +28
{
"id": "S6640",
"message": "Make sure that using "unsafe" is safe here.",
"location": {
"uri": "sources\Net5\Net5\FunctionPointers.cs",
"region": {
"startLine": 3,
"startColumn": 12,
"endLine": 3,
"endColumn": 18
}
}
},
{
"id": "S6640",
"message": "Make sure that using "unsafe" is safe here.",
"location": {
"uri": "sources\Net5\Net5\S4000.cs",
"region": {
"startLine": 5,
"startColumn": 12,
"endLine": 5,
"endColumn": 18
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TPs

context.RegisterNodeAction(c =>
{
if (c.Node is BaseTypeDeclarationSyntax { Modifiers: var modifiers }
&& modifiers.Find(SyntaxKind.UnsafeKeyword) is { } unsafeModifier)

Choose a reason for hiding this comment

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

Same here. Needs a re-base.

{
Report(c, unsafeModifier);
}
}, SyntaxKind.ClassDeclaration, SyntaxKind.InterfaceDeclaration, SyntaxKind.StructDeclaration, SyntaxKindEx.RecordClassDeclaration);

Choose a reason for hiding this comment

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

RecordStruct seems to be missing.

Base automatically changed from Tim/S6640 to master June 21, 2023 13:16
@Tim-Pohlmann Tim-Pohlmann marked this pull request as ready for review June 21, 2023 13:17
@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM.

@Tim-Pohlmann Tim-Pohlmann merged commit 6a2b0dc into master Jun 21, 2023
25 checks passed
@Tim-Pohlmann Tim-Pohlmann deleted the Tim/S6640_Types branch June 21, 2023 14:39
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.

2 participants