CA2204: Literals should be spelled correctly
TypeName | LiteralsShouldBeSpelledCorrectly |
CheckId | CA2204 |
Category | Microsoft.Usage |
Breaking Change | Non Breaking |
This rule checks a literal string that is passed as a value to a parameter or property when one or more of the following cases is true:
-
The LocalizableAttribute attribute of the parameter or property is set to true.
-
The parameter or property name contains "Text", "Message", or "Caption".
-
The name of the string parameter that is passed to a Console.Write or Console.WriteLine method is either "value" or "format".
This rule parses the literal string into words, tokenizing compound words, and checks the spelling of each word/token. For information about the parsing algorithm, see CA1704: Identifiers should be spelled correctly.
By default, the English (en) version of the spelling checker is used.
To fix a violation of this rule, correct the spelling of the word or add the word to a custom dictionary. For information about how to use custom dictionaries, see How to: Customize the Code Analysis Dictionary.
I put the [???] where the grammar error is.
- 1/19/2012
- tballard
- 5/11/2011
- Tadeusz
The CA2204 rule ignores words in the custom dictionary.
See the following connect bug:
https://connect.microsoft.com/VisualStudio/feedback/details/521030/?wa=wsignin1.0
- 10/13/2010
- Dave Sexton
CA2204: Microsoft.Naming: Correct the spelling of the unrecognized token 'CompanyTerm' in the literal '"The CompanyTerm ..."'.
I have attempted to add the words to the custom dictionary that is included in the project. However doing so does not appear to relieve my problem, it only creates another. After adding it to the custom dictionary I then have warning stating that I need to correct the casing in member, function, property, and variable names.
CA1702: Microsoft.Naming: The compound word 'CompanyTerm' in type name 'CompanyTermObject' exists as a discrete term. If your usage is intended to be single word, case it as "Companyterm".
- 5/25/2010
- iseleander