使用 TeamCity 针对我旧的、粗糙的解决方案运行 Fxcop 会产生太多错误
如何让 TeamCity 运行的 Fxcop 限制自身查看更少的规则?
我不想使用 .fxcop 项目,因为这意味着我需要策划在分析中使用哪些 .dll,而不是在 teamcity 构建步骤中使用通配符。
How can I have Fxcop run by TeamCity limit itself to looking at fewer rules?
I don't want to use a .fxcop project as that means I would need to curate which .dlls are used in analysis rather than a wildcard in the teamcity build step.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您确实想要完全禁用某些规则,您有三个基本选项:(
如果您不想冒险引入新的违反这些规则的风险(其中过去显然被破坏得如此频繁),您可能需要考虑抑制旧的违规行为,而不是完全禁用规则。如果是这样,一种方法是将抑制添加到 .fxcop 项目文件(如上面#3 中使用),并附上注释,表明它们是“积压”或“遗留”违规。这可以通过 FxCop UI 中的一个步骤完成,并且允许您将这些抑制与源代码中通过 SuppressMessage 属性指示的“真实”抑制分开。
You have three basic options is you really want to disable some rules entirely:
If you don't want to risk introducing new violations of these rules (which have apparently been broken so frequently in the past), you may want to consider suppressing the old violations instead of disabling the rules entirely. If so, one approach would be to add the suppressions to an .fxcop project file (used as in #3 above) with a note that indicates that they are "backlog" or "legacy" violations. This can be done in a single step from the FxCop UI and would allow you to keep these suppressions separarate from the "real" suppressions indicated via SuppressMessage attributes in your source code.