如何在所有开发者之间共享 FxCop 规则?

发布于 2024-09-24 22:53:01 字数 172 浏览 0 评论 0 原文

我们所有的开发人员都使用VS2010专业版,因此​​无法进行代码分析。我希望他们在签入之前使用 FxCop 分析代码。我已经浏览了规则并禁用了其中一些规则并添加了一些规则。我希望所有开发人员都使用相同的规则集,因为它将是 MSBuild 中使用的规则。如何分发要在 FxCop 中使用的规则集?需要分发哪些文件以及应该分发到哪里?

All our developers are using VS2010 professional so code analysis is not available. I want them to use FxCop to analyze the code before checking in. I have gone through the rules and disabled a bunch of them and added couple of them. I want all the developers to use same set of rules since it will be the rules used in MSBuild. How do I distribute the rule set to be used in FxCop? What files need to be distributed and where is it supposed to go to?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

江挽川 2024-10-01 22:53:02

使用独立 FxCop 时,您可以创建一个 FxCop 项目文件(扩展名为 .fxcop),其中包含要在分析中使用的列表规则。 (通常,该文件还将包括目标程序集的列表,尽管这是可选的。)可以将此文件与您的代码一起签入源代码管理,以便将其分发给处理共享代码库的开发人员。

When using stand-alone FxCop, you can create an FxCop project file (with extension .fxcop) which contains the list rules that are to be used in the analysis. (Typically, the file will also include the list of target assemblies, although this is optional.) This file may be checked into source control with your code in order to distribute it to the developers working on the shared code base.

断肠人 2024-10-01 22:53:01

FxCop 的替代方案或良好补充是使用商业工具 NDepend 。使用此工具,我们可以通过 LINQ 查询编写代码规则 (即 CQLinq) 免责声明:我是该工具的开发人员之一

超过200个代码默认情况下建议规则,其中包括设计架构代码质量代码演化命名约定死代码.NET Fx 使用...

CQLinq 致力于编写可以在 Visual Studio 中实时验证,或者可以是 在构建过程中进行验证并在 HTML/javascript 报告中报告

CQLinq 相对于 FxCop 的优势在于可以直接编写/自定义/共享代码规则,并立即获得结果。建议使用设施来浏览匹配的代码元素。具体来说,它看起来像这样:

CQLinq 代码规则

An alternative or a good complement to FxCop would be to use the commercial tool NDepend. With this tool one can write Code Rule over LINQ Queries (namely CQLinq). Disclaimer: I am one of the developers of the tool

More than 200 code rules are proposed by default, these include design, architecture, code quality, code evolution, naming conventions, dead code, .NET Fx usage...

CQLinq is dedicated to write code rules that can be verified live in Visual Studio, or that can be verified during build process and reported in an HTML/javascript report.

The strength of CQLinq over FxCop, is that it is straightforward to write/customize/share a code rule, and get immediately results. Facilities are proposed to browse matched code elements. Concretely this looks like that:

CQLinq code rule

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文