2

I'm trying to configure FxCop to accept both the compound and discrete versions of a word (InSpecie and Inspecie).

For legacy reasons, both of these need to be considered valid. However, I can't seem to configure the custom dictionary in FxCop to accept both. We have approx. 400 instances of both, and so adding SuppressMessage attributes might not be an option (module-level, maybe, but I'd prefer not to).

I've tried the steps mentioned in a previous question[1], but these words do not appear in the default dictionary provided with FxCop.

Does anyone have any suggestions?

[1] FxCop: Compound word should be treated as discrete term

Community
  • 1
  • 1
Daniel Becroft
  • 716
  • 3
  • 19

1 Answers1

4

You should be able to accept both by adding both the full word and a discrete exception to your custom dictionary. e.g.:

<Dictionary>
<Words>
    <Recognized>
        <Word>inspecie</Word>
    </Recognized>
    <DiscreteExceptions>
        <Term>InSpecie</Term>
    </DiscreteExceptions>
</Words>

However, if you do this, your developers will be free to create new instances of both versions. You might want to seriously consider standardizing on one of the two, then adding suppressions for existing instances of the other. (If you're using stand-alone FxCop, you could add these suppressions in the .fxcop project file instead of the code if you would prefer to not add them even as module-level SuppressMessage attributes.)

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49
  • Thanks, that did it. I tried every other combination, but just not that one. Standardizing on one version is on the list, but unfortunately so are about a thousand other things. For legacy reasons, we need both (at the moment). – Daniel Becroft Oct 18 '11 at 23:45