{"id":23152375,"url":"https://github.com/lombiq/.net-analyzers","last_synced_at":"2025-04-06T16:11:37.160Z","repository":{"id":38815879,"uuid":"281188103","full_name":"Lombiq/.NET-Analyzers","owner":"Lombiq","description":".NET code analyzers and code convention settings for Lombiq projects.","archived":false,"fork":false,"pushed_at":"2025-04-03T13:26:32.000Z","size":473,"stargazers_count":20,"open_issues_count":5,"forks_count":7,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2025-04-05T17:45:17.946Z","etag":null,"topics":["analyzer","code-analysis","dotnet","dotnet-analyzers","editorconfig","fxcop","sonarlint","stylecop"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lombiq.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","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":"2020-07-20T17:51:51.000Z","updated_at":"2025-04-03T13:26:37.000Z","dependencies_parsed_at":"2023-10-03T07:49:17.169Z","dependency_job_id":"9c88e026-5b28-4c95-b037-9e0f6db2f640","html_url":"https://github.com/Lombiq/.NET-Analyzers","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lombiq%2F.NET-Analyzers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lombiq%2F.NET-Analyzers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lombiq%2F.NET-Analyzers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lombiq%2F.NET-Analyzers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lombiq","download_url":"https://codeload.github.com/Lombiq/.NET-Analyzers/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509221,"owners_count":20950232,"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","code-analysis","dotnet","dotnet-analyzers","editorconfig","fxcop","sonarlint","stylecop"],"created_at":"2024-12-17T19:14:28.106Z","updated_at":"2025-04-06T16:11:37.139Z","avatar_url":"https://github.com/Lombiq.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lombiq .NET Analyzers\n\n[![Lombiq.Analyzers NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers/) [![Lombiq.Analyzers.NetFx NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.NetFx?label=Lombiq.Analyzers.NetFx)](https://www.nuget.org/packages/Lombiq.Analyzers.NetFx/) [![Lombiq.Analyzers.OrchardCore NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.OrchardCore?label=Lombiq.Analyzers.OrchardCore)](https://www.nuget.org/packages/Lombiq.Analyzers.OrchardCore/) [![Lombiq.Analyzers.Orchard1 NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.Orchard1?label=Lombiq.Analyzers.Orchard1)](https://www.nuget.org/packages/Lombiq.Analyzers.Orchard1/) [![Lombiq.Analyzers.VisualStudioExtension NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.VisualStudioExtension?label=Lombiq.Analyzers.VisualStudioExtension)](https://www.nuget.org/packages/Lombiq.Analyzers.VisualStudioExtension/)\n\n## About\n\n.NET code analyzers and code convention settings for [Lombiq](https://lombiq.com) projects, for [Orchard Core](https://orchardcore.net/) and any other .NET and .NET Framework apps. We use these to enforce common standards across all our .NET projects, including e.g. all of our [open-source Orchard Core extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions). If you contribute to our open-source projects while using that solution you'll be guided by these rules, too. You can check out a demo video of the project [here](https://www.youtube.com/watch?v=dtbGRi3Cezs), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU).\n\nThere is also support for non-SDK-style .NET Framework projects, as long as they use `PackageReference` for their dependencies (in contrast to _packages.config_).\n\nSome other projects you may be interested in:\n\n- Looking for something similar for JavaScript and SCSS? Check out the ESLint and Stylelint integrations of our [Node.js Extensions project](https://github.com/Lombiq/NodeJs-Extensions).\n- Looking not just for static code analysis but also dynamic testing? Check out our [UI Testing Toolbox](https://github.com/Lombiq/UI-Testing-Toolbox) and [Testing Toolbox](https://github.com/Lombiq/Testing-Toolbox) projects.\n- Looking for a library that'll help you comply with analyzer rules? Check out our [Helpful Libraries project](https://github.com/Lombiq/Helpful-Libraries).\n\nWe at [Lombiq](https://lombiq.com/) also used this module for the following projects:\n\n- The new [City of Santa Monica website](https://santamonica.gov/) when migrating it from Orchard 1 to Orchard Core ([see case study](https://lombiq.com/blog/helping-the-city-of-santa-monica-with-orchard-core-consulting)).\n- The new [Smithsonian Folkways Recordings website](https://folkways.si.edu/) when migrating it from Orchard 1 to Orchard Core ([see case study](https://lombiq.com/blog/smithsonian-folkways-recordings-now-upgraded-to-orchard-core)).\n- The new [Lombiq website](https://lombiq.com/) when migrating it from Orchard 1 to Orchard Core ([see case study](https://lombiq.com/blog/how-we-renewed-and-migrated-lombiq-com-from-orchard-1-to-orchard-core)).\n- The new client portal for [WTW](https://www.wtwco.com/) ([see case study](https://lombiq.com/blog/lombiq-s-journey-with-wtw-s-client-portal)).\n- It also makes [DotNest, the Orchard SaaS](https://dotnest.com/) better.\n\nDo you want to quickly try out this project and see it in action? Check it out in our [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) full Orchard Core solution and also see our other useful Orchard Core-related open-source projects!\n\n## Analyzer packages used\n\nWe added and configured analyzers which are widely used and complement each other.\n\n- [.NET code style analysis](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#code-style-analysis)\n- [.NET code quality analysis](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#code-quality-analysis)\n- [AsyncFixer](https://www.nuget.org/packages/AsyncFixer)\n- [DotNetAnalyzers.DocumentationAnalyzers](https://www.nuget.org/packages/DotNetAnalyzers.DocumentationAnalyzers/)\n- [Meziantou.Analyzer](https://www.nuget.org/packages/Meziantou.Analyzer/)\n- [Microsoft.CodeAnalysis.NetAnalyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers)\n- [Microsoft.VisualStudio.Threading.Analyzers](https://www.nuget.org/packages/microsoft.visualstudio.threading.analyzers)\n- [SecurityCodeScan.VS2019](https://www.nuget.org/packages/SecurityCodeScan.VS2019/)\n- [StyleCop.Analyzers](https://www.nuget.org/packages/StyleCop.Analyzers/)\n- [SonarAnalyzer.CSharp](https://www.nuget.org/packages/SonarAnalyzer.CSharp/)\n\nFurthermore, the project also includes an _.editorconfig_ file with additional configuration for compatible editors.\n\n## Guides\n\n- [Adding analyzers to your project](Lombiq.Analyzers/Docs/AddingAnalyzers.md)\n- [Using the analyzers during development](Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md)\n- [Using the analyzers during command line builds](Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md)\n- [Configuring analyzers](Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md)\n\n## Contributing and support\n\nBug reports, feature requests, comments, questions, code contributions and love letters are warmly welcome. You can send them to us via GitHub issues and pull requests. Please adhere to our [open-source guidelines](https://lombiq.com/open-source-guidelines) while doing so.\n\nThis project is developed by [Lombiq Technologies](https://lombiq.com/). Commercial-grade support is available through Lombiq.\n\n### Publishing a new NuGet package\n\nWhen publishing a new version of the NuGet package, even if it's just a pre-release, also update the package references under _TestSolutions\\Lombiq.Analyzers.PackageReferences_ to the new version. This is necessary to run the tests there.\n\n### Upgrading to a new version of the .NET SDK\n\nWhen a new version of the .NET SDK comes out then to the following:\n\n- Change the `LangVersion` and `AnalysisLevel` elements in the _Build.props_ file to opt in to new language features and analyzers. This does not concern non-SDK-style .NET Framework projects.\n- Wait for all analyzers to support the new SDK (primarily the new language features). Then update all packages to latest.\n- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the _Lombiq.Analyzers.globalconfig_ file.\n\n### Adding a new analyzer\n\nWhen adding a new analyzer package, do the following:\n\n- Check if the project is actively developed with issues addressed quickly.\n- Check if it has any significant impact on build or editing performance.\n- Go through all rules in the package and decide one by one whether we need them.\n  - Check for rules that are already covered by some other analyzer and disable duplicates.\n  - All rules that we need should be surfaced as Warnings. This allows to only break the build on analyzer violations when we need it, i.e. during CI builds but not during development.\n  - Add rule configuration to the _.globalconfig_ file of the relevant project, depending on which kind of applications they're applicable to. Editor-only configuration should be in _.editorconfig_ files.\n- Test it on multiple significant solutions. Using the [Hastlayer SDK](https://github.com/Lombiq/Hastlayer-SDK) is a good example as it's a large C# solution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flombiq%2F.net-analyzers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flombiq%2F.net-analyzers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flombiq%2F.net-analyzers/lists"}