This project is read-only.

SP2100 Limit line size could be ignored some times

Jan 10, 2012 at 11:23 AM

We have a nomenclarute for strings in the resource strings. The resource string key must be the same as the string without spaces like RSThisIsTheKeyOfAResourceString. The problem is some of them are longer than the line limit. Can be an exception for this cases?

It would be great if a line like this "ResourceStrings.RSThisIsAVeryLongLineForAResourceStringAndWillExcedTheLineLimit" doesn't show a warning.

Jan 10, 2012 at 7:27 PM

Hi sbaxter,

Just to make sure I understood you right.

You are OK that the following would be violated:

string message = String.Format(ResourceStrings.RSThisIsAVeryLongLine, arg1, arg2);

but want to allow:

string message = String.Format(

(where line 2 is actually very-very long).

Did I got you right?

Best regards,
Oleg Shuruev

Jan 11, 2012 at 11:53 AM

Hi Oleg,

Exactly, the second line could be a very long line.



Jan 15, 2012 at 10:50 PM

Should the following be allowed?

string message = String.Format(
    ResourceStrings.RSThisIsAVeryLongLine + "..." + "???",

In my point of view, it should not and needs to be overwritten to something like

string message = String.Format(
        + "..." + "???",

What do you think?

Best regards,
Oleg Shuruev

Jan 17, 2012 at 9:10 AM

I agree with you.

But I do not follow all the MS rules, I have a "mix" because I develop in delphi too. I cut to the new line until the end of line is reached, not in every argument, so in this case is not too important for me. Saying that I will write it like:


string message = String.Format(
    + "..." + "???", arg1, arg2);



Feb 5, 2012 at 8:15 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.