Skip to content

craigktreasure/Treasure.Analyzers

Repository files navigation

Treasure.Analyzers

CI Build codecov

This repository contains my common analyzers. See the supported rules.

Treasure.Analyzers.MemberOrder

Nuget NuGet

An analyzer that ensures that class members are ordered by type, keyword, accessibility level, and then by name. It also includes a code fix to reorder members appropriately.

CodeMaid comparison

This analyzer was heavily inspired by the fantastic CodeMaid. There are some important differences.

Improvements over CodeMaid:

  • Uses modern Roslyn analyzer tooling.
  • As a Roslyn analyzer, the rules can be integrated into the build to enforce member ordering at build time.
  • The code fixups associated with the analyzer work anywhere Roslyn code fixups are supported: Visual Studio, Visual Studio Code, etc.. No extension required.
  • In addition to interface, class, and struct, the analyzer supports the newer record and record struct declaration types as well.
  • Running code fixups will not remove newer C# keywords like required, which happens today when reordering using CodeMaid.

Limitations compared to CodeMaid:

  • The analyzer is not yet configurable.
  • The analyzer does not support code regions: #region MyRegion.
  • Likely others.

About

.NET Analyzers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published