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

Rule S6613: Implement CodeFix #7250

Merged
merged 5 commits into from
May 30, 2023
Merged

Conversation

cristian-ambrosini-sonarsource
Copy link
Contributor

@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource commented May 23, 2023

Fixes #7239
RSPEC PR: SonarSource/rspec#1953

var diagnosticSpan = diagnostic.Location.SourceSpan;

if (root.FindNode(diagnosticSpan, getInnermostNodeForTie: true) is IdentifierNameSyntax identifierSyntax
&& identifierSyntax is { Parent: ExpressionSyntax { Parent: InvocationExpressionSyntax invocationExpression } expression })
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parent ExpressionSyntax will cover both SimpleMemberAccessExpression for simple invocations and MemberBindingExpression for conditional expressions.

Copy link
Member

@costin-zaharia-sonarsource costin-zaharia-sonarsource left a comment

Choose a reason for hiding this comment

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

It looks good to me. I've added a few pedantic comments that are optional and a question to better understand why some of the test cases were changed.

Copy link
Contributor

@sebastien-marichal sebastien-marichal left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

Choose a reason for hiding this comment

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

LGTM! The failing test seems to be related to other changes and not this PR. Can you please check before merging?

@sonarqubecloud
Copy link

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

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

91.7% 91.7% Coverage
0.0% 0.0% Duplication

@pavel-mikula-sonarsource pavel-mikula-sonarsource merged commit 7cbbb44 into master May 30, 2023
@pavel-mikula-sonarsource pavel-mikula-sonarsource deleted the cristian/S6613-codefix branch May 30, 2023 06:18
@pavel-mikula-sonarsource pavel-mikula-sonarsource changed the title Rule S6613: implement CodeFix Rule S6613: Implement CodeFix May 30, 2023
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.

Rule S6613: implement CodeFix
5 participants