How can you get FxCop rule CA1726 to ignore a preferred term?
Asked Answered
A

1

8

FxCop has a rule (CA1726) that checks for preferred terms. This looks for words like "Dont" and tells you to replace them with better words like "Do not". Generally this is fine, however one of the terms it objects to is "Flag". At our firm, the business deals with Flags meaning those cloth things at the end of flagpoles. Suppressing this rule each time is becoming a pain. Does anyone know a way to get this rule to work on everything except "Flag"?

Note: I know I can turn the rule off completly, but I don't want to do that. I just want to turn off part of the rule.

Anywise answered 11/2, 2009 at 11:33 Comment(0)
A
6

I have answered my own question.

It turns out that the list of preferred terms is listed in the CustomDictionary.xml file that is in the FxCop install directory (C:\Program Files\Microsoft FxCop 1.36\CustomDictionary.xml). There is a section <Dictionary><Words><Deprecated> that contains a number of <Term> elements. Simply removing the ones I don't want has done the trick.

Anywise answered 11/2, 2009 at 13:2 Comment(1)
But how to do it for all developers? I don't like the idea to do the same on all PC's and build servers.Histrionics

© 2022 - 2024 — McMap. All rights reserved.