SA1650
TypeName |
ElementDocumentationMustBeSpelledCorrectly |
CheckId |
SA1650 |
Category |
Documentation Rules |
The element documentation for the element contains one or more spelling mistakes or unrecognized words.
A violation of this rule occurs when the element documentation contains spelling mistakes:
/// <summary>
/// Joinsnames
/// </summary>
/// <param name="firstName">The first name.</param>
/// <param name="lastName">The last name.</param>
/// <returns>Name</returns>
public string JoinNames(string firstName, string lastName)
{
...
}
The spelling is checked using the culture specified in the Settings.StyleCop file (and en-US by default).
In this example the word Joinsnames in the summary element is misspelled. Either correct the spelling, insert any C# names in <c> </c> elements, suppress the violation or add the Joinsnames to a CustomDictionary.xml file.
CustomDictionary.xml files can contain words that the spelling checker does not normally recognise.
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>The CustomDictionary.xml file should be placed in the same folder as the
StyleCop.dll and the Rules. That folder (and all subfolders) are checked for the
dictionary files.</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>StyleCop loads CustomDictionary.xml, CustomDictionary.en-GB.xml and then
CustomDictionary.en.xml (where en-GB is the culture specified in the
Settings.StyleCop file).</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>StyleCop also loads custom.dic, custom.en-GB.dic and then custom.en.dic
(where en-GB is the culture specified in the Settings.StyleCop file).</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>Recognized words can also be added to the Settings.StyleCop file using the
Settings Editor on the spelling tab.</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>Attribute values in the documentation xml of the element are not checked
for spelling.</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>Any text inside <c> </c> or <code> </code> elements is also ignored.</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<o:p>Any text starting with and ending with '$' or starting and ending with '$$'
is also ignored. i.e. $$(thtp kthpo kthpk)$$.</o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-vertical-align-alt: auto; mso-layout-grid-align: none">
<SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes">
</SPAN></P>
<P></P>
<H2>How to Fix Violations</H2>
<P>To fix a violation of this rule, correct any spelling mistakes in the element
documentation.</P>
<h2>How to Suppress Violations</h2>
<pre>[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")]</pre>
</div></div>
</body>
- - SA0102 - Clean Install
- - Download
- - Documentation Rules - Layout Rules - Maintainability Rules - Naming Rules - Ordering Rules - Readability Rules - Spacing Rules - Suppressions
- - Adding a custom StyleCop settings page - Adding custom rule settings - Authoring a custom styleCop rule - Authoring rules metadata - Custom CSharp Language Service - Custom MSBuild Integration - Hosting StyleCop in a Custom Environment - Installing a Custom Rule - Integrating StyleCop Into Build Environments - Integrating StyleCop into MSBuild - Writing Custom Rules for StyleCop