WiseTechGlobal / WTG.Analyzers

Analyzers from WiseTech Global to enforce our styles, behaviours, and prevent common mistakes.
Other
15 stars 3 forks source link

WI00547438 - Pointless interpolated strings analyzer #202

Closed yaakov-h closed 1 year ago

yaakov-h commented 1 year ago

This replaces #194 as I can't push to @theawesomew's fork.

closes: #143

brian-reichle commented 1 year ago

It seems that despite updating NUnit, it's not running all the .NET Framework unit tests, in particular it's not discovering any tests in WTG.Analyzers.TestFramework.Test (net472) or WTG.Analyzers.Utils.Test (net472)

brian-reichle commented 1 year ago

Should add the following samples and fix:

Foo($"\r\n");
Foo($"{{}}");
Foo($@"<document>
</document>");

should become:

Foo("\r\n");
Foo("{}");
Foo(@"<document>
</document>");

but actually becomes:

Foo("\\r\\n");
Foo("{{}}");
Foo("<document>\r\n</document>");