Skip to content

suppression-justification

C#styleno fixdefault: offcsharp/stylecop

Reports a SuppressMessage attribute whose Justification is missing, null, empty, blank, or "<Pending>". The attribute is matched by name. No fix.

A suppression hides a warning for good, and the reason is the only information a later reader has to judge whether it still holds. The text generated by tools (“<Pending>”) is a placeholder that stays forever.

To fix, write why the warning does not apply.

Reported
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("C", "I")]
[assembly: SuppressMessage("C", "I", Justification = "<Pending>")]
namespace N { class Other { void M() {
...
#endregion
...
csharp:
lint:
rules:
suppression-justification: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line suppression-justification in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
StyleCop SA1404 full