Here is AutoMapper Static Analyzers.
The main reason to write this VS Extension and NuGet package is that developers who is not so familiar with AutoMapper sometimes use it not proper way.
The project already contains:
- AutoMapper.Analyzers.Common - common AutoMapper Analyzers
- AutoMapper.Analyzers.Common.CodeFixes - common fixes for raised AutoMapper Analyzers diagnostics
- AutoMapper.Analyzers.Common.Package - project for building and publishing the NuGet package
- AutoMapper.Analyzers.Common.Tests - tests for common AutoMapper Analyzers
- AutoMapper.Analyzers.Vsix - project to create VS Extension package
Smells | Availability | Codes | Level | Description | Fix |
---|---|---|---|---|---|
Common smells | Available | AMA0001 | Warrning | Profile doesn't contain maps | In Progress... |
AMA0002 | Identical names properties are manual mapped | Available | |||
AMA0003 | Manual checking that src is not null | Available for next checking: "??", "== null", "!= null" | |||
AMA0005 | Manual flattening of complex model | Available | |||
AMA0006 | Manual flattening of naming similar complex model | Available | |||
AMA0007 | Useless try-catch/finally covering of CreateMap calls. | Available | |||
In Plans | AMA0004 | ForMember ignore for all left properties | ... |
There are two ways to install analyzers:
Just add AutoMapper.Contrib.Analyzers package into a project which you would like to control.
In case of installation VSIX extention any project will be checking by AutoMapper.Analyzers. So far, there is only one way to install the extension:
- Build Vsix project
- Find in
...\AutoMapper.Analyzers\package\AutoMapper.Analyzers.Vsix\bin\Release
folderAutoMapper.Analyzers.Vsix.vsix
file - Run it
In nearest future VSIX extension will be pushed into VSIX repository.