Substage - 制作符合 MS StyleCop 的模板
我最近有一个规模很大的爱好项目,大约 66K LOC,位于 http://www.wheelmud.net ,一名团队成员获得了符合 MS StyleCop 的大部分代码。 唯一剩下的就是我们的数据层。 正如您可以想象的那样,它会经常重新生成,因为我们仍处于开发的早期阶段。
我尝试修改 aspx 模板,但我发现有很多问题需要修复。 我首先看到的是 using 语句位于名称空间声明之上。 有什么方法可以通过模板修改此行为,还是我需要对 SubStage 的代码进行电锯操作?
我不介意更改源代码,但我想在开始之前先询问一下。我之前曾在其他项目中这样做过。
I have a good sized hobby project, around 66K LOC, over at http://www.wheelmud.net Recently, a team member got the bulk of the code MS StyleCop compliant. The only thing left is our data layer. As you can imagine, this gets regenerated fairly often, as we are still in the early stages of development.
I tried modifying the aspx templates, but I saw quite a few things that I need fixed. The first thing I saw was that the using statements were on top of the namespace declaration. Is there any way to modify this behavior through the templates, or do I need to take a chainsaw to SubStage's code?
I don't mind changing the source, but I wanted to ask first before I jump in. I have done this before for other projects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将把所有现有模板滚动到 T4 中,以避免将来出现模板问题。 我们仍然会支持旧的东西 - 但使用 T4 来做到这一点确实会对像您这样的情况有帮助
I'm going to roll all of the existing templates into T4 to avoid future template issues. We'll still support the old stuff - but using T4 to do this will really help situations like yours
在 2.2 版本中,添加了一个补丁,将标签添加到生成的文件顶部,这样它们就会被 StyleCop 忽略。 查看此问题。
In version 2.2, a patch was added to add a tag to the top of generated files so they would be ignored by StyleCop. See this issue.