代码分析 - CA1704:更正“Ps”的拼写
我从 VS2010 中的代码分析收到以下警告
CA1704:Microsoft.Naming:正确 会员姓名中“Ps”的拼写 'MyClass.PsCalculatedAmount' 或删除 如果它代表任何种类,则完全如此 匈牙利表示法。
现在,在我的代码库中,“Ps”的意思是“每股”,并且被大量使用,因此我希望允许它作为可接受的单词/首字母缩略词。
我尝试将其添加到我的 CustomDictionary.xml 下
<Words>
<Recognized>
<Word>ps</Word>
...
<Recognized>
<Words>
并尝试过,
<Acronyms>
<CasingExceptions>
<Acronym>Ps</Acronym>
...
<CasingExceptions>
<Acronyms>
但我仍然收到警告。
我应该做些什么不同的事情吗?
我注意到 FXCop 中存在一个与此相关的错误,现已修复; http://social.msdn.microsoft.com/Forums/ en/vstscode/thread/54e8793c-e821-49b2-80db-ea1420acf1e6
我使用的 Visual Studio 版本 V10.0.30319 中是否仍然存在此错误?
I am getting the following warning from Code Analysis in VS2010
CA1704 : Microsoft.Naming : Correct
the spelling of 'Ps' in member name
'MyClass.PsCalculatedAmount' or remove
it entirely if it represents any sort
of Hungarian notation.
Now in my codebase 'Ps' means 'Per Share' and is used heavily, so I would like to allow it as an acceptable word/acronym.
I tried adding it to my CustomDictionary.xml under
<Words>
<Recognized>
<Word>ps</Word>
...
<Recognized>
<Words>
and also tried
<Acronyms>
<CasingExceptions>
<Acronym>Ps</Acronym>
...
<CasingExceptions>
<Acronyms>
but I still get the warning.
Is there something I should be doing differently?
I noticed that there had been a bug in FXCop regarding this which is now fixed;
http://social.msdn.microsoft.com/Forums/en/vstscode/thread/54e8793c-e821-49b2-80db-ea1420acf1e6
Is there a chance that this bug still exists in the version of Visual Studio i am using: V10.0.30319?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它被拒绝,因为它在代码分析安装文件夹(通常为 %ProgramFiles%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop)的“根”自定义词典中被标记为无法识别的单词。您需要将其从根词典不可识别列表中删除,然后才能将其添加为项目特定词典中的已识别单词才会生效。
It's being rejected because it's flagged as an unrecognized word in the "root" custom dictionary in Code Analysis installation folder (usually %ProgramFiles%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop). You'll need to remove it from the root dictionary unrecognized list before adding it as a recognized word in a project-specific dictionary will take effect.
“Ps”也是我字典中
部分的一部分(我从未更改过它)。除了将其添加到
部分之外,还要将其从
部分中删除。"Ps" is also part of the
<Unrecognized>
section in my dictionary (and I never altered it). Apart from adding it to<Recognized>
section, also remove it from the<Unrecognized>
section.