让 Stylecop 自动修复 C# 中的问题
是否有可能让时尚警察来解决任何问题?或者有其他工具可以解决风格警察问题吗?
我知道有些问题的编码可能很复杂,但是这个“SA1101:对 UpdateButtonLocations 的调用必须以“this”开头。前缀来指示该项目是该类的成员。”看起来修复起来应该相当简单。
通过阅读周围的内容,我认为可以集成 Resharper,以便它在编码时警告您任何问题,虽然这很有用,但它对我在现有项目上没有帮助,该项目有 100 个与上面类似的警告!
Is it possible to get style cop to fix any issues? Or any other tool to fix the style cop issues?
I understand that some of the issues may be complicated to code for but this one "SA1101: The call to UpdateButtonLocations must begin with the 'this.' prefix to indicate that the item is a member of the class." looks like it should be fairly trivial to fix.
From reading around I think Resharper can be integrated so that it warns you of any issues as you code, and while this is useful it won't help me on an existing project with 100s of warnings similar to the one above!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ReSharper 有一个可用的 style cop 插件(请查看此处)。这样,您可以选择手动清理它,或者在 ReSharper 的“清理代码”功能中自动清理它。
There is a style cop addin for ReSharper available (Look here). With that you can have the option to clean it manually or within the "Clean Code" functionality of ReSharper do it automatically.
Resharper 确实有一个干净的解决方案,可以对解决方案中的所有文件执行此操作。好主意或坏主意取决于你:)
Resharper does have a clean solution that will do this to all files in the solution. Good idea or bad idea is up to you :)
Visual Studio 2010 中内置了许多重构选项,Resharper(商业版)等附加组件还添加了更多选项。
这些大多是自动的,将加快解决此类问题的速度。
There are many refactoring options built into Visual Studio 2010, and add-ons like Resharper (commercial) add many more.
These are mostly automatic and will speed up fixing such issues.