Announcing the release of Microsoft StyleCop

We are very excited to announce the release of a new developer tool from Microsoft, Source Analysis for C#. This tool is known internally within Microsoft as StyleCop, and has been used for many years now to help teams enforce a common set of best practices for layout, readability, maintainability, and documentation of C# source…

95

StyleCop 4.3 Is Released

The awaited StyleCop 4.3 update is now available. This update includes: Various bugfixes, including fixes for VS integration issues Rules documentation is included and integrated into VS “Show Error Help” New rules (more detail below) Branding change from Source Analysis to StyleCop As promised, we will also be releasing SDK documentation for StyleCop explaining how to author…

34

A Brief History Of C# Style

A number of astute developers have noted that the C# code style enforced by Microsoft StyleCop differs in some ways from the style typically seen in sample code coming from the Microsoft Developer Division. For example, the very fine book Framework Design Guidelines by Krzysztof Cwalina and Brad Abrams includes many code samples which use a…

34

Setting Up StyleCop MSBuild Integration

This article explains how to integrate the StyleCop tool into an MSBuild based build environment, for StyleCop 4.3 and above. If you are using SourceAnalysis 4.2, please see the following article: http://blogs.msdn.com/sourceanalysis/pages/stylecop-4-2-msbuild-integration.aspx. MSBuild integration will cause the tool to run automatically whenever the code is built, and StyleCop violations will show up alongside compiler errors in the build…

30

Future Plans

Since the release of StyleCop, many people have pointed out that a number of the rules enforced by the tool could be automatically corrected by the tool, without requiring the developer to do the corrections manually. As you might imagine, this functionality is also highly desired by the developers using StyleCop within Microsoft, and this will…

10

StyleCop 4.3 SDK

The SDK documentation for StyleCop 4.3 is now available for download, here: https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis&ReleaseId=1425 This documentation explains how to create and install custom StyleCop rules, how to integrate custom settings into the StyleCop settings dialog, and how to create a wrapper for hosting StyleCop in a custom build environment.

4

Clearing up Confusion

There has been some confusion and a few mixed messages coming out of Microsoft since the release of StyleCop, most notably around extensibility support for the tool, and licensing. We’ve gotten a lot of great feedback from the community, and in the last few weeks there have been some good discussions between various teams internally about how…

4

StyleCop 4.2 MSBuild Integration

This article explains how to integrate the StyleCop tool into an MSBuild based build environment. This type of integration will cause the tool to run automatically whenever the code is built, and StyleCop violations will show up alongside compiler errors in the build output. It is possible to set up the build integration so that StyleCop violations will…

3

StyleCop update 4.3.1.3 is released

We have just released an update to StyleCop 4.3 which contains a number of bugfixes as well as a small number of new features. In particular: Ability to use <include> tags within Xml header documentation to pull docs from external files. Get accessor in property required to appear before set accessor .generated.cs files ignored by…

2

StyleCop Build Integration

The following article describes how to integrate StyleCop into the build, so that the tool will run automatically whenever a build is performed:  http://blogs.msdn.com/sourceanalysis/pages/source-analysis-msbuild-integration.aspx

1