是否有 Visual Studio 插件或加载项可让您检查代码格式和约定。这包括检查缩进、间距、行距、函数名称或变量的大小写、检查是否采用帕斯卡大小写或驼峰大小写等。任何与编码约定相关的内容。当然,我们可以设置这些。如果可能的话,我们可以保存此设置以供其他项目导入。
如果它在 Visual Studio 编辑器上(例如突出显示行语句)或 VS 控制台上(如果有任何违反约定的情况)发出警告或其他内容,那就太好了。
我找到了 Code Style Enforcer,这可能没问题,但这需要来自 devexpress 的 DXCore,它可供出售或 30 天试用。我需要一个免费的插件。 Tnx...:D
Is there a Visual Studio plug-n or add-in which allows you to check code formats and conventions. This would include checking the indention, spacing,line spacing, casing of function names or variables, check if pascal case or camel case, etc. Anything which relates to coding convention. And of course we are allowed to set these. And if possible we can save this settings to be imported for other projects.
It would also be nice if it puts a warning or something on the visual studio editor(e.g. highlighting the line statement) or on the VS console if there are any violations on the convention.
I found Code Style Enforcer and this could have been fine but this needs DXCore from devexpress which is for sale or for a 30-day trial. I need a free add-in. Tnx... :D
发布评论
评论(7)
听起来您正在寻找 StyleCop 和/或 FxCop。
It sounds like you're looking for StyleCop and/or FxCop.
尝试 FXCop 或 ReSharper
Try FXCop or ReSharper
用于 StyleCop 插件 rel="nofollow noreferrer">ReSharper 是免费的,但 ReSharper 不是免费的。如果您已经安装了 ReSharper,祝您狩猎愉快。如果你不这样做,你真的应该这样做。 =)
如果您想要主动语法突出显示而不是构建后分析,则需要该插件。
The StyleCop plugin for ReSharper is free, however ReSharper is not. If you've already got ReSharper, happy hunting. If you don't, you really should. =)
You want the plugin if you want active syntax highlighting instead of post-build analysis.
Visual Studio 2008 的更昂贵版本包括代码分析,它本质上是内置于 IDE 中的 FxCop。您可以检查是否有它,因为项目属性上会出现“代码分析”选项卡。如果您没有它,那么我支持尝试 FxCop 的建议,尽管我不确定将来是否会维护它。
The more expensive editions of Visual Studio 2008 include Code Analysis, which is essentially FxCop built into the IDE. You can check if you have it because a "Code Analysis" tab appears on the project properties. If you don't have it then I back the recommendation to try FxCop, although I'm not sure if it will be maintained in the future.
您正在寻找 FXCop,这是 Microsoft 提供的免费工具:
http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx
You're looking for FXCop, a free tool from Microsoft:
http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx
StyleCop 以及 StyleFix 和 GhostDoc 构成了一个很棒的“免费三人组” 。
我听说过 CodeStyleEnforcer 但还没有尝试过... 。 (立即下载)
StyleCop along with StyleFix and GhostDoc make a great "FREEsome threesome".
I've heard of CodeStyleEnforcer but haven't tried it... Yet. (Downloading now)
还有 Regionerate ,它的功能与 FxCop 相同,但它是免费的。
There's also Regionerate which does the same thing as FxCop, but it's free.