如何实施编码风格约定 [英] How to enforce coding style conventions

查看:74
本文介绍了如何实施编码风格约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




当我的公司进入C#时,他们在源代码中强制使用样式

约定,例如方法命名约定,换行,




有人知道擅长这份工作的产品吗? (免费和/或

商业广告)

Hi,

As my company is moving into C# they are enforcing the use of styling
convention in the source code, such as methods naming conventions, newlines,
etc.

Does someone know of products that are good at this job? (free and/or
commercial)

推荐答案

Ron Burd写道:
Ron Burd wrote:
随着我的公司进入C#,他们在源代码中强制使用样式
约定,例如方法命名约定,
换行等。

是否有人知道擅长这项工作的产品吗? (免费和/或
商业)
As my company is moving into C# they are enforcing the use of styling
convention in the source code, such as methods naming conventions,
newlines, etc.

Does someone know of products that are good at this job? (free and/or
commercial)




MS提供免费工具:FxCop
http://www.gotdotnet.com/team/fxcop/


-

问候

Jochen


你需要一个内存泄漏查找器吗?
http://www.codeproject.com/tools/leakfinder.asp

您是否需要来自服务器的每日报告?
http:/ /sourceforge.net/projects/srvreport/



There is a free tool from MS: FxCop
http://www.gotdotnet.com/team/fxcop/

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Do you need daily reports from your server ?
http://sourceforge.net/projects/srvreport/


Ron Burd< rb *** @ hexacta.com>写道:
Ron Burd <rb***@hexacta.com> wrote:
当我的公司进入C#时,他们在源代码中强制使用样式
约定,例如方法命名约定,换行符,
等。 />
有人知道擅长这项工作的产品吗? (免费和/或
商业)
As my company is moving into C# they are enforcing the use of styling
convention in the source code, such as methods naming conventions, newlines,
etc.

Does someone know of products that are good at this job? (free and/or
commercial)




你试过FxCop吗?

http://www.gotdotnet.com/team/fxcop/


-

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet

如果回复小组,请不要给我发邮件



Have you tried FxCop?

http://www.gotdotnet.com/team/fxcop/

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


我知道FxCop,但是AFAIK它通过内省来实现它的chking

(反射)的Exe或Dll。

怎么能我让FxCop检查我的源代码?


每个例子(注意大括号):


如果我们想确保编写代码采用以下风格:


if(something == true){

...

}


而不是


if(something == true)

{

...

}


或th在常数中使用全部字母命名。


" Jon Skeet [C#MVP]" < SK *** @ pobox.com>在消息中写道

新闻:MP ************************ @ msnews.microsoft.c om ...
I am aware of FxCop, but AFAIK it does its chking through introspection
(reflection) of the Exe or Dll.
How can I make FxCop check my source code?

Per example (note the braces):

If we want to ensure that the code is written in the following style:

if ( something == true) {
...
}

instead of

if (something ==true)
{
...
}

or that constants are named using All-Caps letters.

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Ron Burd< rb *** @ hexacta.com>写道:
Ron Burd <rb***@hexacta.com> wrote:
当我的公司进入C#时,他们在源代码中强制使用样式
约定,例如方法命名约定,
换行符等。 />
有人知道擅长这项工作的产品吗? (免费和/或
商业)
As my company is moving into C# they are enforcing the use of styling
convention in the source code, such as methods naming conventions, newlines, etc.

Does someone know of products that are good at this job? (free and/or
commercial)



你试过FxCop吗?

http://www.gotdotnet.com/team/fxcop/

-
Jon Skeet - < sk *** @ pobox.com>
http:// www.pobox.com/~skeet
如果回复小组,请不要给我发邮件



Have you tried FxCop?

http://www.gotdotnet.com/team/fxcop/

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too



这篇关于如何实施编码风格约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆