Analyzers For Optimizely CMSAvoid some easy mistakes when building Optimizely sites with these analyzers.If you have been working with Optimizely CMS (previously Episerver) you have probably at least once forgotten that little "virtual" keyword when adding a new property to a page or block type. You wont know that something is wrong until you try to run the project. That was true, until now! Analyzers For Optimizely CMS will also warn about when an attribute is expected but not found. (For example on Initializable modules, content types, scheduled jobs.) Read more on available analyzers below. No hard dependenciesAnalyzers For Optimizely CMS will not error if no Optimizely packages are present, it does not require any specific version. In fact, some analyzers have been confirmed working with versions as old as Episerver 8! While analyzers may work on very old versions, focus will only be on supporting CMS 11 and later. Learn from the analyzersMy goal is for all analyzers to not just tell you what you did wrong but also explain why its wrong, what may be happening in the background and how to fix the issue if a fix is not offered as a code fix. Just click on the Analyzer id in the Error List tool window, the popup when hovering over the warning or code fix preview in Visual Studio to learn more. How to getYou can get Analyzers For Optimizely CMS both as an extension to Visual Studio 2022 for use with all your projects and as a NuGet package to bring the analyzer to your CI/CD pipeline as well as everyone working on a project. The nuget options is the recommended one. Installing analyzers as an extension comes with some limitations causing some analyzers not to work, one example being the checks for reused guids. Available analyzersHere are a quick overview of some of the things the analyzers test for:
More will come! ContributeDo you want to report a bug or suggest a feature? Do you see something in the documentation that can be improved? Do you want to help creating new analyzers, tests or writing documentation? Create an issue and let us take it from there. |