StyleCop

{{Short description|Static program analysis software}}

{{Infobox software

| name = StyleCop

| author = Microsoft

| developer = Jason Allor,
Andy Reeves,
Chris Dahlberg

| latest release version = 5.0.6329.1

| latest release date = {{Start date and age|2017|04|30}}

| repo = {{URL|https://github.com/StyleCop/StyleCop}}

| programming language = C#

| operating system = Microsoft Windows

| platform = .NET Framework

| genre = Static code analysis tool

| license = Microsoft Public Licence

| website = {{URL|https://github.com/StyleCop}}

}}

StyleCop is an open-source static code analysis tool from Microsoft{{cite web|url=https://blogs.msdn.microsoft.com/sourceanalysis/2008/05/25/a-brief-history-of-c-style/|title=A Brief History Of C# Style|date=25 May 2008 |access-date=2016-07-19}} that checks C# code for conformance to StyleCop's recommended coding styles and a subset of Microsoft's .NET Framework Design Guidelines. StyleCop analyses the source code, allowing it to enforce a different set of rules from FxCop (which, instead of source code, checks .NET managed code assemblies).{{cite web |url=http://www.techrepublic.com/blog/programming-and-development/maintain-code-consistency-with-microsoft-stylecop/4328 |title=Maintain code consistency with Microsoft StyleCop |publisher=TechRepublic |work=Blogs / Software Engineer |date=June 24, 2011 |accessdate=December 10, 2011 |author=Patton, Tony}}{{cite web |url=http://www.serversidemagazine.com/asp-net/8-more-useful-tools-for-asp-net/ |title=8 More Useful Tools for ASP.NET |publisher=Server-Side Magazine |work=ASP .Net |date=July 30, 2009 |accessdate=December 10, 2011 |author=Chinery, Clive}} The rules are classified into the following categories:

  • Documentation
  • Layout
  • Maintainability
  • Naming
  • Ordering
  • Readability
  • Spacing

StyleCop includes both GUI and command-line versions of the tool. It is possible to add new rules to be applied.

StyleCop was originally developed by Jason Allor as a Microsoft internal tool, and was released externally as an open-source project in April 2010 on CodePlex.

StyleCop 4.7.55 (November 10, 2016) is compatible with Visual Studio 2008, 2010, 2012, 2013, and 2015.https://stylecop.codeplex.com/ StyleCop (old CodePlex site) (Microsoft Visual Studio Extension)

StyleCop began a move to GitHub in December 2014,https://api.github.com/repos/StyleCop/StyleCop GitHub API response for StyleCop repository and the last change applied to the CodePlex edition was November 11, 2016.https://web.archive.org/web/20171226050423/http://stylecop.codeplex.com/SourceControl/list/changesets archive.org retrieval of StyleCop on CodePlex source history

StyleCop 5.0.6329.1 (April 30, 2017) works with Visual Studio 2012, 2013, 2015, and 2017.https://marketplace.visualstudio.com/items?itemName=ChrisDahlberg.StyleCop StyleCop - Visual Studio Marketplace (Windows Installer)

Development is stopping. A named successor is StyleCopAnalyzers, for Visual Studio 2015 and later.https://github.com/StyleCop/StyleCop#considerations StyleCop repository on GitHub

See also

{{Portal|Free and open-source software}}

References

{{Reflist}}