Spell checking of the comments was added to the recent versions of StyleCop. It seems I can reuse my existing CustomDictionary file (that I created for FxCop) with StyleCop. SA1650 rule documentation does not say that it is possible. But in release notes for version 4.7.39 I see
Add support for specifying dictionary folders in the settings.StyleCop file.
How do I configure StyleCop to search for this file in the root folder of my solution?
In my case it worked when I specified the custom dictionary entries in the Settings.StyleCop file located next to the .csproj file.
<GlobalSettings>
<StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
<CollectionProperty Name="RecognizedWords">
<Value>word1</Value>
<Value>word2</Value>
...
</CollectionProperty>
</GlobalSettings>
Actually, the StyleCopSettingsEditor.exe utility created these settings for me. I opened it using the project's context menu in Visual Studio, using the "StyleCop Settings" menu item.
Add a file named Settings.StyleCop
in your solution root directory with the following content:
<StyleCopSettings Version="105">
<GlobalSettings>
<CollectionProperty Name="DictionaryFolders">
<Value>**my-dictionary-folder**</Value>
</CollectionProperty>
</GlobalSettings>
</StyleCopSettings>
Where you replace my-dictionary-folder
with the relative path to the folder containing your CustomDictionary.xml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With