GU0072
November 24, 2021 ยท View on GitHub
All types should be internal
| Topic | Value |
|---|---|
| Id | GU0072 |
| Severity | Warning |
| Enabled | False |
| Category | Gu.Analyzers.Correctness |
| Code | GU0072AllTypesShouldBeInternal |
Description
All types should be internal. This analyzer is default disabled as we normally do not want this. If for some reason you want all types internal you can enable it.
Motivation
Not sure when this is useful.
How to fix violations
Make classes and structs internal.
Configure severity
Via ruleset file.
Configure the severity per project, for more info see MSDN.
Via #pragma directive.
#pragma warning disable GU0072 // All types should be internal
Code violating the rule here
#pragma warning restore GU0072 // All types should be internal
Or put this at the top of the file to disable all instances.
#pragma warning disable GU0072 // All types should be internal
Via attribute [SuppressMessage].
[System.Diagnostics.CodeAnalysis.SuppressMessage("Gu.Analyzers.Correctness",
"GU0072:All types should be internal",
Justification = "Reason...")]