IntelliTect / IntelliTect/CodingGuidelines
Where to include message for #pragma disable?
- 主要言語
- C#
- スター
- 12
- フォーク
- 16
- 平均マージ
- 2分
- マージ済み PR(30日)
- 7
説明
If I am disabling a warning, what is the format of the justification message.
Here's an idea/approach but it is still ugly, better suggestions welcome:
```
// Justifiction: Properties initialized by Entity Framework.
#nullable disable // CS8618: Non-nullable field is uninitialized. Consider declaring as nullable.
public ApplicationDbContext(
#nullable enable
DbContextOptions? options) : base(options) { }
// Justifiction: Properties initialized by Entity Framework.
#nullable disable // CS8618: Non-nullable field is uninitialized. Consider declaring as nullable.
public ApplicationDbContext(
#nullable enable
```
or, with pragma:
```
// Justification: Uninitialized properties set by Entity Framework.
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
public ApplicationDbContext(DbContextOptions options) : base(options) { }
#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
```
コントリビューションガイド
評価
この issue はまだ評価されていません。