Skip to content

SA1518 fails whether there is a newline character or not #3887

Open
@AArnott

Description

StyleCop.Analyzers: 1.2.0.556

SA1518 is claiming exactly one code file in my solution is not allowed to end with a newline character.
This is odd in itself, because I have a policy that all code files should end with a newline character, so I don't know why this file is not allowed to:
image

Even more confusing is that "correcting" this by removing the newline character produces the same diagnostic but with a contrary message, saying I must end the file with a newline character:
image

Repro:

git clone  https://github.com/microsoft/vs-servicehub.git
cd vs-servicehub
git checkout 6c6880dd568b1816d0c2afd089ec3a6f9407d107
.\init.ps1
.\Microsoft.ServiceBroker.sln

Then open the src\AssemblyInfo.cs file.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions