dotnet/roslyn

IDE0040 'Accessibility modifiers required' should be configurable to ignore partial containing classes

オープン

#52,904 opened on 2021/04/25

 (12 件のコメント) (9 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEConcept-Continuous ImprovementFeature - IDE0040help wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

I don't like duplicating the accessibility modifiers on the second file, but out of the box now, .NET 5 puts a suggestion annotation in the code and the error list to do so:

internal sealed partial class A // Or some other modifiers
{
    // ...
}
// ℹ IDE0040 Accessibility modifiers required
//            ↓
partial class A
{
    private sealed class B
    {
        // ...
    }
}

Could IDE0040 please skip analyzing classes that are only specifying the minimal amount necessary to declare the nested type? If not, could this be made configurable?

コントリビューターガイド