Skip to content

SA1514 is falsely reported when documenting types declared in the global namespace #3849

@Arthri

Description

@Arthri
/// <summary>
/// X.
/// </summary>
public class K
{
}

SA1514: Element documentation header should be preceded by blank line is reported on the first /// in the file. Adding the new line resolves the diagnostic but instead raises SA1517: Code should not contain blank lines at start of file, leading to an infinite loop. Furthermore, the class has been intentionally declared in the global namespace, so there is no space for a namespace declaration

Activity

bjornhellander

bjornhellander commented on May 29, 2024

@bjornhellander
Contributor

I can confirm this using 1.2.0-beta.556, regardless of how bad practice it might be :-)
SA1514 does however not go away for me, when adding a newline before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @sharwell@bjornhellander@Arthri

      Issue actions

        SA1514 is falsely reported when documenting types declared in the global namespace · Issue #3849 · DotNetAnalyzers/StyleCopAnalyzers