我可以在 StyleCop 中创建自定义规则而无需编写任何代码吗?
有人可以确认或否认我可以通过修改某些配置文件来修改 StyleCop 提供的默认样式吗?
Can anybody confirm or deny that I can modify default styles provided by StyleCop by just modifying some configuration file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以禁用规则,但如果您想检查自定义样式,则必须编写自己的规则。您可以阅读StyleCop的API帮助文件。
You can disable rules but if you want to check a custom style, you will have to code your own rules. You may read the API help file of StyleCop.
创建新规则需要一些 C# 代码。请参阅此处和此处了解一些有关自定义规则创建的文章。
您可以使用配置文件启用/禁用现有规则。 Stylecop 附带 StyleCopSettingsEditor.exe,可用于编辑/生成 xml 配置文件以配置将运行的规则。有关如何禁用特定规则的信息,请参阅此问题。
Creation of new rules requires some C# code. See here and here for some articles on custom rule creation.
You can enable/disable the existing rules with a configuration file. Stylecop comes with the StyleCopSettingsEditor.exe which can be used to edit/generate a xml config file to configure which rules will be run. See this question on how to disable specific rules.