You need to add Capitalised and non capitalised forms of the same word to the dictionary

Sep 28, 2012 at 4:00 PM

Consider that you have the following comment:

        /// <summary>
        /// Analyse Data.
        /// </summary>
        /// <remarks>This method is used to analyse data.</remarks>

StyleCop creates two warnings:

Warning 1 SA1650 : CSharp.Documentation : The documentation text within the summary tag contains incorrectly spelled words: Analyse Z:\Documents\Visual Studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 24 1 TestStyleCop
Warning 2 SA1650 : CSharp.Documentation : The documentation text within the remarks tag contains incorrectly spelled words: analyse Z:\Documents\Visual Studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 24 1 TestStyleCop

and you need to add both Analyse and analyse to your dictionary. Is it possible to add only one of the word forms to suppress all warnings?

Coordinator
Sep 28, 2012 at 4:08 PM
Edited Sep 30, 2012 at 11:53 AM
If you add the word with a capital letter it already automatically adds the lowercase version to the dictionary as well.


~A.
Sep 28, 2012 at 4:16 PM
Edited Sep 30, 2012 at 12:33 PM
Andy,
Thanks for your quick answer. I’ll try that.
Kind regards
Francois Roussel
Sent from Windows Mail

From: andyr

If you add the word with a capital letter it already automatically adds the lowercase version to the dictionary as well.


~A.

On 28 Sep 2012, at 16:00, froufrou <notifications@codeplex.com> wrote:

From: froufrou

Consider that you have the following comment:

        /// <summary>
        /// Analyse Data.
        /// </summary>
        /// <remarks>This method is used to analyse data.</remarks>

StyleCop creates two warnings:

Warning 1 SA1650 : CSharp.Documentation : The documentation text within the summary tag contains incorrectly spelled words: Analyse Z:\Documents\Visual Studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 24 1 TestStyleCop
Warning 2 SA1650 : CSharp.Documentation : The documentation text within the remarks tag contains incorrectly spelled words: analyse Z:\Documents\Visual Studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 24 1 TestStyleCop

and you need to add both Analyse and analyse to your dictionary. Is it possible to add only one of the word forms to suppress all warnings?

Sep 28, 2012 at 4:37 PM

Unfortunately it does not seem to work. I'm using 4.7.38 on Windows 8 with Visual Studio 2012..

I went to the StyleCop settings, spelling tab, added Analyse to the dictionary. If II open the Settings.StyleCop file there is jus one entry with Analyse. If I start Stylecop on the file I still get a warning saying that analyse is an incorrectly spelled word.

What am I missing?

Coordinator
Sep 28, 2012 at 6:08 PM

Sorry, it only worked like that for words in the CustomDictionary.xml files. In build 4.7.39 it works as described above now.

Developer
Sep 28, 2012 at 9:20 PM

Try changing the localization in your settings to  en-GB

Sep 30, 2012 at 11:34 AM
Edited Sep 30, 2012 at 12:33 PM
Thanks for the suggestion but although I used an en-GB spelling in my example that was not really the point of my question. Now that brings me to another request:
We use write all our XML documentation in US English as it is easier like that with tools like code analysis and GhostDoc but we also specify that the default resource language of our assemblies is en-GB as our clients are UK based. All is well except for the generated cs resource file where the XML comment reuses the resource string value. That string is using UK spelling and then StyleCop complains that some words are misspelled because it checks against the US dictionary. Could it be possible for StyleCop to check XML comments for string resource generated properties using the default assembly’s resources culture?
Francois Roussel
Sent from Windows Mail
From: mightymuke

Try changing the localization in your settings to en-GB

Coordinator
Sep 30, 2012 at 11:52 AM
Hi,

If your documentation is to be in en-US then ensure you're culture in your Settings.StyleCop file is en-US.

Now for your resources. StyleCop doesn't know the assembly's resources culture as its just analysing a text file. You can either add those words into your Settings.StyleCop file (using the new Spelling tab) or add suppressions into the source (class level would stop spelling checks in all the resources file)


Hope that helps.

-A.
Sep 30, 2012 at 11:56 AM
Edited Sep 30, 2012 at 12:33 PM
Hi Andy,
That’s basically what I’ve done so far: StyleCop settings en-US and add the few words used in resources where US and UK spellings differ to the dictionary using the spelling tab. I just thought that if that was possible that would be a nice to have.
Regards
Francois Roussel
Sent from Windows Mail
Hi,
If your documentation is to be in en-US then ensure you're culture in your Settings.StyleCop file is en-US.
Now for your resources. StyleCop doesn't know the assembly's resources culture as its just analysing a text file. You can either add those words into your Settings.StyleCop file (using the new Spelling tab) or add suppressions into the source (class level would stop spelling checks in all the resources file)
Hope that helps.
-A.
Coordinator
Sep 30, 2012 at 12:23 PM

Ad fyi - you might want to edit your posts in this discussion to remove your email address before you get spammed.