让 Stylecop 自动修复 C# 中的问题

发布于 2024-12-22 13:54:35 字数 243 浏览 1 评论 0原文

是否有可能让时尚警察来解决任何问题?或者有其他工具可以解决风格警察问题吗?

我知道有些问题的编码可能很复杂,但是这个“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

表情可笑 2024-12-29 13:54:35

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.

深巷少女 2024-12-29 13:54:35

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 :)

妄断弥空 2024-12-29 13:54:35

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文