StyleCop XML 文档标头 - 使用 3 /// 而不是 2 //
我在 c# 文件上使用 XML 文档标头来传递 StyleCop 规则 SA1633。
目前,我必须使用 2 个斜杠注释规则来允许 StyleCop 识别标题。例如:
// <copyright file="abc.ascx.cs" company="MyCompany.com">
// MyCompany.com. All rights reserved.
// </copyright>
// <author>Me</author>
这对于 StyleCop 来说效果很好,但是我想使用 3 个斜杠注释规则来使 Visual Studio 能够将注释理解为 XML 并提供 XML 功能(突出显示、自动缩进等)
/// <copyright file="abc.ascx.cs" company="MyCompany.com">
/// MyCompany.com. All rights reserved.
/// </copyright>
/// <author>Me</author>
问题是,当使用 3 个斜杠时,StyleCop 不再看到标题并抛出 SA1633 警告。
无论如何,是否可以配置 stylecop 以了解标头包含在 XML 中使用 3 个斜杠?
I am using XML documentation headers on my c# files to pass the StyleCop rule SA1633.
Currently, I have to use the 2 slash commenting rule to allow StyleCop to recognize the header. for example:
// <copyright file="abc.ascx.cs" company="MyCompany.com">
// MyCompany.com. All rights reserved.
// </copyright>
// <author>Me</author>
This works fine for StyleCop, however I would like to use the 3 slash commenting rule to enable visual studio to understand the comments as XML and provide the XML functionality (highlighting, auto indenting etc)
/// <copyright file="abc.ascx.cs" company="MyCompany.com">
/// MyCompany.com. All rights reserved.
/// </copyright>
/// <author>Me</author>
The problem is that when using 3 slashes, StyleCop no longer see's the header and throws the SA1633 warning.
Is there anyway to configure stylecop to understand the header is contained in XML using 3 slashes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以构建自定义规则并禁用原始规则以支持新规则:
http://scottwhite.blogspot.com/2008 /11/creating-custom-stylecop-rules-in-c.html
You could build a custom rule and disable the original in favour of your new one:
http://scottwhite.blogspot.com/2008/11/creating-custom-stylecop-rules-in-c.html