IntelliTect / IntelliTect/CodingGuidelines
Where to include message for #pragma disable?
- Ngôn ngữ chính
- C#
- Star
- 12
- Fork
- 16
- Merge trung bình
- 2 phút
- Pull request đã merge (30 ngày)
- 7
Mô tả
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.
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.