Home

Awesome

Rainbow data analyzer

This project contains the source code for the Visual Studio extension and NuGet package of a Roslyn analyzer that checks Sitecore ID's and paths with serialized data. The Rainbow data format that is used by Unicorn is supported here.

Installation prerequisites

Include .yml files in your project

Roslyn can only access files that are included in the project. They don't have to be visible, though and you can use wildards. So it's really not that big of a deal.

However, try to limit the amount of files that are included, as it may make things very slow if your project needs to load thousands of files. It would be good practice anyway to limit the files to those that are needed by your project; in line with Helix principles.

Steps to include files:

 <ItemGroup>
   <AdditionalFiles Include="..\Sitecore.Data\Unicorn\templates\**\*.yml">
     <Visible>false</Visible>
   </AdditionalFiles>
 </ItemGroup>

Installation to integrate this into your build

Install the NuGet package from the package manager or the package manager console:

Install-Package RainbowDataAnalyzer

Installation of the Visual Studio extension only

Install RainbowDataAnalyzer from the extensions and updates window.

How it works

This is a Roslyn analyzer, which means that it plugs into the compiler API's to check the code syntax and/or semantics. This particular analyzer currently checks all string literal expressions.

Furthermore, if you follow the following rules, the analyzer will also check if the fields that are being used are on the right template.

If you want to change the severity of the checks (e.g.: make something a warning instead of an error), you can do this for individual projects in Visual Studio:

Future plans

I'd like to add support for the following features in the future. If you have any more suggestions, please add an issue.

Release notes

1.5.1

1.5.0

1.4.0

1.3.0

1.2.0

1.1.0

1.0.0