C# S2275 False Positive?

56 views
Skip to first unread message

bugrepo...@gmail.com

unread,
Apr 20, 2017, 5:08:25 PM4/20/17
to SonarLint
The following C# code throws S2275 Invalid string format, all format items should comply with the following pattern '{index[,alignment][:formatString]}'.

Console.WriteLine(string.Format("{0:##:##:##}", 112233));

Doesn't this code follow the pattern properly? The formatString is allowed to have the : character in it.

Freddy Mallet

unread,
Apr 21, 2017, 2:59:34 AM4/21/17
to bugrepo...@gmail.com, SonarLint
I think your issue relates to https://github.com/SonarSource/sonar-csharp/issues/222 which should be quickly fixed.
Thanks for your feedback
Freddy


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/986cd217-9b19-4428-9fc8-8251ac94432e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Freddy MALLET | SonarSource

Co-Founder

@FreddyMallet

http://sonarsource.com


Reply all
Reply to author
Forward
0 new messages