Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 2.02 KB

README.md

File metadata and controls

44 lines (32 loc) · 2.02 KB

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.