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

Add repro for S6678 #9552

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Add repro for S6678 #9552

merged 2 commits into from
Jul 25, 2024

Conversation

sebastien-marichal
Copy link
Contributor

@sebastien-marichal sebastien-marichal commented Jul 24, 2024

Repro for #9545

Copy link
Contributor

Choose a reason for hiding this comment

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

More test cases needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to create to support @$ and $$$ syntax available in C# 8 & C# 11.

Copy link

sonarcloud bot commented Jul 24, 2024

Copy link

sonarcloud bot commented Jul 24, 2024

{
logger.LogDebug($@"{nameof(Repro_9545)} filter: {{number}}", number); // Compliant - FN
logger.LogDebug(@$"{nameof(Repro_9545)} filter: {{number}}", number); // Compliant - FN
logger.LogDebug($$"""{{nameof(Repro_9545)}} filter: {number}""", number); // Compliant - FN

Choose a reason for hiding this comment

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

This is a bit surprising. It actually should raise given that implementation looks into interpolated string text portions. Nevermind. It is documented now.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@martin-strecker-sonarsource martin-strecker-sonarsource merged commit a5c109c into master Jul 25, 2024
24 checks passed
@martin-strecker-sonarsource martin-strecker-sonarsource deleted the sma/repro-9545 branch July 25, 2024 08:21
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