开发者

Checkstyle for C#?

开发者 https://www.devze.com 2022-12-23 02:54 出处:网络
I\'m looking to find something along the lines of Checkstyle for Visual Studio.I\'ve recently started a new gig doing .NET work and realized that coding standards here are a bit lacking.While I\'m sti

I'm looking to find something along the lines of Checkstyle for Visual Studio. I've recently started a new gig doing .NET work and realized that coding standards here are a bit lacking. While I'm still a young guy and far from the most experienced developer I'm trying to lead by example and get things going in the right direction.

I loved the ability to use Checkstyle with Eclipse and examine code before reviews so I'd like to do the 开发者_如何学Gosame thing with Visual Studio. Anyone have any good suggestions?

Another thing I'd be somewhat interested in is a plug-in for SVN that disallows check-in until the main coding standards are met. I do not want people checking in busted code that's going to wind up in a code review.

Any suggestions at this point would be great.


Have you tried StyleCop?

  • http://code.msdn.microsoft.com/sourceanalysis

Note: This's been moved to https://github.com/StyleCop


Take a look at resharper.


We use StyleCop to enforce our coding standards. It is free and integrates nicely with Visual Studio


What you're looking for is called Static Code Analysis.

FxCop is one option. I think Resharper can check this kind of thing as well.


Here are some of the great tools you can use

FxCop is a code analysis tool that checks .NET managed code assemblies for conformance to the Microsoft .NET Framework Design Guidelines


ReSharper is a refactoring and productivity plugin by JetBrains that extends native functionality of Microsoft Visual Studio .NET 2003, 2005 and 2008.


StyleCop is a free static code analysis tool from Microsoft that checks C# code for conformance to StyleCop's recommended coding styles and a subset of Microsoft's .NET Framework Design Guidelines

ref: http://blogs.msdn.com/fxcop/


Have you had a chance to review StyleCop


If you are looking for a long term supported version, I would recommend to look to Roselyn analyzers. They are the native support for Static Code Analysis with pre-configured rules, custom configs, and allow extensions.

According to the docs: “.NET compiler platform (Roslyn) analyzers inspect your C# or Visual Basic code for code quality and style issues.”

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号