如何停止 Stylecop 设置默认为顶级父级
我正在尝试为我们这里的项目创建 StyleCop 设置。我的想法是更新设置并存储在 Subversion 中,以便它自动正确设置。
默认情况下,某些规则在顶级设置(在程序文件中)中被禁用,因此我在项目中重新启用了它们,并获得了如下规则:
<Rule Name="DocumentationTextMustBeginWithACapitalLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
现在我想要的是每个规则都有一个大文件明确设置或不设置,但即使我将文件设置为不与父级合并,它也只会启用或禁用与 Program Files 中的规则不同的规则。
I am trying to create a StyleCop settings for the projects we have here. My idea is that I will update the settings and store in Subversion so that it is automatically set up properly.
Some of the rules are disable by default in the top-level settings (in Program Files) so I have re-enabled them in my project and have gained rules like this:
<Rule Name="DocumentationTextMustBeginWithACapitalLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
Now the thing I wanted was to have one large file with every rule explicitly set or not but even if I set the file to not merge with the parent it only enables or disables rules that are different to the one in Program Files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您对根设置文件不太正确。事实上,它是空的(除非您对其进行了编辑)。
您正在处理的是默认属性。有些规则默认启用,有些则禁用。此信息不存储在任何设置文件中,实际上存储在 StyleCop 程序集中。
而且,当您保存设置文件时,它永远不会保存与默认设置相同的设置。
You are not quite right about root settings file. In fact, it is empty (unless you have edited it).
The thing you are dealing with is default properties. Some rules are enabled by default, some are disabled. This information is not stored in any settings file, it is stored in StyleCop assembly in fact.
And, when you save your settings file, it will never save the settings which are equal to the default ones indeed.