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

Fix styling issues on new code #9220

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

pavel-mikula-sonarsource
Copy link
Contributor

Cleanup after #9207

@github-actions github-actions bot added this to In progress in Best Kanban Apr 29, 2024
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 29, 2024
Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann left a comment

Choose a reason for hiding this comment

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

LGTM. I found two more whitespace violations that you might want to fix while you're at it.

Comment on lines 46 to 50
node.Ancestors().Any(x => x.IsAnyKind(SyntaxKind.IfStatement,
SyntaxKind.SwitchStatement,
SyntaxKindEx.SwitchExpression,
SyntaxKind.ConditionalExpression,
SyntaxKindEx.CoalesceAssignmentExpression));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
node.Ancestors().Any(x => x.IsAnyKind(SyntaxKind.IfStatement,
SyntaxKind.SwitchStatement,
SyntaxKindEx.SwitchExpression,
SyntaxKind.ConditionalExpression,
SyntaxKindEx.CoalesceAssignmentExpression));
node.Ancestors().Any(x => x.IsAnyKind(
SyntaxKind.IfStatement,
SyntaxKind.SwitchStatement,
SyntaxKindEx.SwitchExpression,
SyntaxKind.ConditionalExpression,
SyntaxKindEx.CoalesceAssignmentExpression));

Comment on lines 52 to 54
private static bool IsAssignedToStaticFieldOrProperty(SonarSyntaxNodeReportingContext context) =>
context.Node.Parent.WalkUpParentheses() is AssignmentExpressionSyntax assignment
&& context.SemanticModel.GetSymbolInfo(assignment.Left, context.Cancel).Symbol is { IsStatic: true, Kind: SymbolKind.Field or SymbolKind.Property };
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static bool IsAssignedToStaticFieldOrProperty(SonarSyntaxNodeReportingContext context) =>
context.Node.Parent.WalkUpParentheses() is AssignmentExpressionSyntax assignment
&& context.SemanticModel.GetSymbolInfo(assignment.Left, context.Cancel).Symbol is { IsStatic: true, Kind: SymbolKind.Field or SymbolKind.Property };
private static bool IsAssignedToStaticFieldOrProperty(SonarSyntaxNodeReportingContext context) =>
context.Node.Parent.WalkUpParentheses() is AssignmentExpressionSyntax assignment
&& context.SemanticModel.GetSymbolInfo(assignment.Left, context.Cancel).Symbol is { IsStatic: true, Kind: SymbolKind.Field or SymbolKind.Property };

@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Apr 30, 2024
Copy link

sonarcloud bot commented Apr 30, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 30, 2024

@pavel-mikula-sonarsource pavel-mikula-sonarsource merged commit 3622c4a into master Apr 30, 2024
26 checks passed
Best Kanban automation moved this from Review approved to Validate Peach Apr 30, 2024
@pavel-mikula-sonarsource pavel-mikula-sonarsource deleted the Pavel/CleanCode branch April 30, 2024 06:33
@pavel-mikula-sonarsource pavel-mikula-sonarsource moved this from Validate Peach to Done in Best Kanban May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Best Kanban
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants