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

False positive for SA1013 with newlines inside interpolations #3898

Open
jnm2 opened this issue Nov 10, 2024 · 0 comments
Open

False positive for SA1013 with newlines inside interpolations #3898

jnm2 opened this issue Nov 10, 2024 · 0 comments

Comments

@jnm2
Copy link
Contributor

jnm2 commented Nov 10, 2024

C# 11+ allows newlines inside interpolations (https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#newlines-in-string-interpolations).

With the following code snippet, and version 1.2.0-beta.556:

_ = $"abc {"some long C# expression here, after which I want to indent"
    } def";

SA1013 is reported on }. It misidentifies this as a closing brace of a block statement. Its own definition should even be allowing this:

A closing brace should always be preceded by a single space, unless it is the first character on the line.

@jnm2 jnm2 changed the title False positives for SA1013 and SA1513 with newlines inside interpolations False positive for SA1013 with newlines inside interpolations Nov 10, 2024
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

No branches or pull requests

1 participant