Microsoft.Naming: CA1703

  • Thread starter Thread starter Joe Monnin
  • Start date Start date
J

Joe Monnin

While using VS2008, I have a word that is beging flaged by the static code
analysis tool as a violation of CA1703,
ResourceStringsShouldBeSpelledCorrectly. I have added the word to my
CustomDictionary.xml file and set it's build action to
"CodeAnalysisDictionary". I still get the error.

The word is actually an abbreviation: ECN which means "Engineering Change
Notice." In my case, I need to refer to the ECN in the plural, so I have it
written as "ECNs" which is correct according to to Microsoft Manual of Style
V3 which states "form the plural of an acronum by adding an s with no
apostrophe." It further gives the examples of "APIs" and "CPUs" as correct
plural abreviations. Following this rule, "ECNs" is correct, but try as I
might, I cannot get the Visual Studio Static Code Analysis tool to stop
complaining about "ECNs". If I spell it in all uppercase as "ECNS" it's
happy, but with the "s" is lowercase, it complains. Is there a solution
short of using the SuppressMessage attribute?
 
Hello,

I think several rules do apply here:

1. Acronyms should only be capitalized if they consist of two letters.
2. All other acronyms should be spelled in PascalCase.
3. Well-known acronyms should be spelled all uppercase (API, CPU, etc)
4. With a plural, append a lowercase s

I hope I remember them all correctly - I don't have my Framework Design
Guidelines book around.

So... try Ecns.

Kind regards,
Henning Krause
 
How do you PascalCase an acronym? Each letter represents the start of a word
so the whole thing would be uppercased, no? In any event, ECN is a well
known acronym in my industry. If ECNs was a variable name, I would have no
problem with your suggestion, but since this is a piece of text displayed to
the user, it should follow the MoS rules and be displayed ECNs. Are you
saying there is no way to to allow this with the CustomDictionary?
 
Hi Joe,

I'm not sure about the custom dictionary.

Kind regards,
Henning Krause
 
Back
Top