Recommended References

Table of Contents

Goals

To have consistency in code-style among the different tools/plugins the use of Analysers is recommended, especially the use of StyleCop. Additionally code-style analysis using StyleCopy (and code generation in the IDE) should be properly configured using a stylecop.json-file as well as .editorconfig-file, respectively.

Example-Files can be found at:

These rules are only applied for project types addin and module.

Usage

Using this package automatically enables this guideline.

Settings

Opt-Out

It it possible to opt-out of the check for recommended references by using the CakeContribGuidelinesOmitRecommendedReference setting and setting it's Include to the reference that should not be checked.

(Keep in mind, though, that it is not recommended to opt-out of this feature)

<ItemGroup>
    <CakeContribGuidelinesOmitRecommendedReference Include="StyleCop.Analyzers" />
</ItemGroup>

It is possible to opt-out of the check for configuration-files by using the CakeContribGuidelinesOmitRecommendedConfigFile setting and setting it's Include to the file name that should not be checked:

<ItemGroup>
    <CakeContribGuidelinesOmitRecommendedConfigFile Include="stylecop.json" />
    <CakeContribGuidelinesOmitRecommendedConfigFile Include=".editorconfig" />
</ItemGroup>
GitHub Discussion