{"id":17770694,"url":"https://github.com/bkoelman/csharpguidelinesanalyzer","last_synced_at":"2025-04-04T09:08:54.655Z","repository":{"id":11445893,"uuid":"69706513","full_name":"bkoelman/CSharpGuidelinesAnalyzer","owner":"bkoelman","description":"Reports diagnostics for C# coding guidelines that are not already covered by Resharper.","archived":false,"fork":false,"pushed_at":"2024-05-18T10:10:05.000Z","size":2164,"stargazers_count":149,"open_issues_count":1,"forks_count":31,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T08:07:13.349Z","etag":null,"topics":["analyzer","c-sharp","coding-guidelines"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bkoelman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-30T22:31:57.000Z","updated_at":"2025-03-27T14:48:50.000Z","dependencies_parsed_at":"2024-04-20T13:32:08.842Z","dependency_job_id":"d0f98d57-a75c-4445-a080-a4892e96124a","html_url":"https://github.com/bkoelman/CSharpGuidelinesAnalyzer","commit_stats":{"total_commits":661,"total_committers":6,"mean_commits":"110.16666666666667","dds":"0.13918305597579428","last_synced_commit":"2a211ae77207ced486b2b8126f5e92c9b2909488"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkoelman%2FCSharpGuidelinesAnalyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkoelman%2FCSharpGuidelinesAnalyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkoelman%2FCSharpGuidelinesAnalyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkoelman%2FCSharpGuidelinesAnalyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkoelman","download_url":"https://codeload.github.com/bkoelman/CSharpGuidelinesAnalyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149501,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analyzer","c-sharp","coding-guidelines"],"created_at":"2024-10-26T21:24:46.074Z","updated_at":"2025-04-04T09:08:54.615Z","avatar_url":"https://github.com/bkoelman.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSharp Guidelines Analyzer\n\n[![Build status](https://ci.appveyor.com/api/projects/status/q37dldfggtcwf6u4/branch/master?svg=true)](https://ci.appveyor.com/project/bkoelman/csharpguidelinesanalyzer/branch/master)\n[![codecov](https://codecov.io/gh/bkoelman/CSharpGuidelinesAnalyzer/branch/master/graph/badge.svg)](https://codecov.io/gh/bkoelman/CSharpGuidelinesAnalyzer)\n\nThis Visual Studio analyzer supports you in making your code comply with the C# coding guidelines at [CSharpGuidelines](https://github.com/dennisdoomen/CSharpGuidelines).\n\nNote that many guidelines are already covered by [Resharper](https://www.jetbrains.com/resharper/), for which [a layer file is provided](/docs/Resharper%20Settings.md).\nSee [Overview](/docs/Overview.md) for the list of supported rules.\n\n![Analyzer in action](https://github.com/bkoelman/CSharpGuidelinesAnalyzer/blob/gh-pages/images/analyzer-in-action.png)\n\n## Get started\n\nThe latest version requires [Visual Studio 2017 with Update 5](https://www.visualstudio.com/) or higher. To get instant feedback on all files in your solution, activate [Full Solution Analysis](/docs/Full%20Solution%20Analysis.md).\n\n* From the NuGet package manager console:\n\n  `Install-Package CSharpGuidelinesAnalyzer`\n\n  or, if you are using Visual Studio 2017 with Update 3:\n\n  `Install-Package CSharpGuidelinesAnalyzer -version 2.0.0`\n\n  or, if you are using Visual Studio 2015 with Update 2 or higher:\n\n  `Install-Package CSharpGuidelinesAnalyzer -version 1.0.1`\n\n* Rebuild your solution\n\n* Optional: [Reference CSharpGuidelines.Layer.DotSettings in your existing Resharper preferences](/docs/Resharper%20Settings.md)\n\n## Rule configuration\nThe behavior of a few rules can optionally be customized using a configuration file. See [documentation](docs/Configuration.md) for details.\n\n## Suppressing rules\nRule warnings can be suppressed at various scopes, ranging from per line to at the project or solution level.\n\n* With `#pragma` lines, for example:\n```csharp\n#pragma warning disable AV1532 // Loop statement contains nested loop\n    foreach (string item in itemArray)\n#pragma warning restore AV1532 // Loop statement contains nested loop\n```\nOn the location of a warning, press **Ctrl+.** or **Alt+Enter** and select **Suppress**, **in Source**.\n\n* In `GlobalSuppressions.cs`, for example:\n```csharp\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"Maintainability\", \"AV1532:Loop statement contains nested loop\", Justification = \"\u003cPending\u003e\", Scope = \"member\", Target = \"~M:CSharpGuidelinesDemo.Demo.RunDemo(System.String[][],System.Boolean,System.String)~System.Collections.Generic.List{System.String}\")]\n```\nOn the location of a warning, press **Ctrl+.** or **Alt+Enter** and select **Suppress**, **in Suppression File**.\nNote that you can broaden the suppression scope by removing the `Target` and/or `Scope` attributes:\n\n```csharp\n[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(\"Maintainability\", \"AV1532:Loop statement contains nested loop\", Justification = \"\u003cPending\u003e\")]\n```\n\n* In an .editorconfig file, which contains [rule severities](https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#set-rule-severity-in-an-editorconfig-file):\n\n```ini\nroot = true\n\n[*.cs]\ndotnet_diagnostic.av1115.severity = error\ndotnet_diagnostic.av1130.severity = suggestion\n```\n\n* In a custom .ruleset file, which contains Code Analysis settings:\n\nRight-click your project, select **Properties**, tab **Code Analysis**. Click **Open**, expand **CSharpGuidelinesAnalyzers** and uncheck the rules you want to disable. When you save changes, a .ruleset file is added to your project.\n\nAlternatively, navigate to your project in **Solution Explorer** and expand **References**, **Analyzers**, **CSharpGuidelinesAnalyzer**. Then right-click on one of the rules and select **Set Rule Set Severity**. These changes are stored in a .ruleset file in your project.\n\nTo apply the custom ruleset to the entire solution, move the .ruleset file next to your .sln file and browse to it on the CodeAnalysis tab for each project.\n\n## Performance\n\nIf you run these analyzers on a large codebase and are concerned about performance, consider disabling AV1568 and AV1739. These two are by far the most resource-intensive.\n\n## Contribute!\n\nThe analyzers in this project benefit a lot from testing on various codebases. Some of the best ways to contribute are to try things out, file bugs, and join in design conversations.\n\n## Trying out the latest build\n\nAfter each commit, a new prerelease NuGet package is automatically published to AppVeyor at https://ci.appveyor.com/project/bkoelman/csharpguidelinesanalyzer/branch/master/artifacts. To try it out, follow the next steps:\n\n* In Visual Studio: **Tools**, **NuGet Package Manager**, **Package Manager Settings**, **Package Sources**\n    * Click **+**\n    * Name: **AppVeyor CSharpGuidelinesAnalyzer**, Source: **https://ci.appveyor.com/nuget/csharpguidelinesanalyzer**\n    * Click **Update**, **Ok**\n* Open the NuGet package manager console (**Tools**, **NuGet Package Manager**, **Package Manager Console**)\n    * Select **AppVeyor CSharpGuidelinesAnalyzer** as package source\n    * Run command: `Install-Package CSharpGuidelinesAnalyzer.NuGetBugRequiresNewId -pre`\n\n## Building from source\n\nClone the repository and open `CSharpGuidelinesAnalyzer.sln` in Visual Studio.\nYou can now build and run the tests.\n\nTo debug an analyzer, set a breakpoint and press F5. This launches a second (experimental) Visual Studio instance with the debugger attached. In the experimental instance, open a project and observe your breakpoint get hit.\n\nNote: When using Visual Studio 2022 or higher, breakpoints don't get hit unless you change the following setting **in the experimental instance**:\n\n* Tools \u003e Options \u003e Text Editor \u003e C# \u003e Advanced \u003e Uncheck 'Run code analysis in separate process'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkoelman%2Fcsharpguidelinesanalyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkoelman%2Fcsharpguidelinesanalyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkoelman%2Fcsharpguidelinesanalyzer/lists"}