宪兵规则定制
有谁知道明确指定宪兵将使用哪些规则的正确方法?或者排除哪些规则?我并没有很高兴在 Mono 文档中寻找答案。
我想做的是在 Gendarme Rules.xml 文件中一一指定规则,如下所示:
<rules include="AvoidAssemblyVersionMismatchRule" from="Gendarme.Rules.BadPractice.dll"/>
这样做,我希望我们可以关闭我们不关心的规则。问题是,在以这种方式指定所有规则之后,与使用宪兵提供的默认方法相比,我检测到的缺陷数量不同,其形式为:
<rules include="*" from="Gendarme.Rules.BadPractice.dll"/>
<rules include="*" from="OTHER DLL NAMES"/>
以前有人这样做过吗?或者有人可以向我指出一些宪兵规则使用文档的方向吗?
Does anyone know the correct way to explicitly specify which rules Gendarme will use? Or which rules to exclude? I'm not having a lot of joy searching the Mono documentation for the answer.
What I'm trying to do is to specify the rules one by one in the Gendarme rules.xml file like this:
<rules include="AvoidAssemblyVersionMismatchRule" from="Gendarme.Rules.BadPractice.dll"/>
Doing this, I'm hoping we can then switch off the rules we don't care about. The problem is, after specifying all the rules in this way, I'm getting a different number of defects detected compared with when I use the default method Gendarme provides, which is of the form:
<rules include="*" from="Gendarme.Rules.BadPractice.dll"/>
<rules include="*" from="OTHER DLL NAMES"/>
Has anyone done this before? Or can anyone point me in the direction of some Gendarme rules usage documentation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题:
按照我上面概述的那样明确指定规则是自定义规则列表的正确方法,我得到不同数量结果的原因是宪兵中设置的“默认”规则省略了扫描代码闻起来,一旦我将此扫描添加到默认列表中,缺陷总数就会匹配。
To answer my own question:
Specifying the rules explicitly as I outlined above is the correct way to customise the rules list, the reason I was getting a different number of results back was because the "default" rule set in Gendarme leaves out scanning for Code Smells, once I added this scan to the default list, the defect totals matched.