Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Code Analysis stop warning about a certain variable name

I have a variable named like allowedZHs. ZH is a domain specific acronym. ZHs is its plural form. I would like to continue using that plural form. I find it much more expressive than the "correct" form "Zhs".
I tried to tell Code Analysis this by adding a Code Analysis Dictionary. This works fine for the singular form "ZH" but it doesn't work for the plural form.
I still get warning CA1704.

I tried adding it as a recognized word and adding it as an acronym:

<Dictionary>
  <Words>
    <Recognized>
      <Word>ZHs</Word>
    </Recognized>
  </Words>
  <Acronyms>
    <CasingExceptions>
      <Acronym>ZHs</Acronym>
    </CasingExceptions>
  </Acronyms>
</Dictionary>

Any ideas what I am doing wrong?

like image 565
Daniel Hilgarth Avatar asked Feb 26 '13 15:02

Daniel Hilgarth


1 Answers

The bad news is that there's no way to use the dictionary to allow plural acronyms in older FxCop versions. (See, for example, Kevin Blasko's answer at http://social.msdn.microsoft.com/Forums/eu/vstscode/thread/56af1337-895d-47ec-ac72-71cf0316ea60.) The good news is that the version that ships with VS 2012 allows them out-of-the-box, so you won't even need to touch the dictionary when you eventually upgrade.

like image 122
Nicole Calinoiu Avatar answered Nov 15 '22 08:11

Nicole Calinoiu