Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCS0036 without GenerateDocumentationFile shows error #1608

Open
curcas opened this issue Jan 17, 2025 · 2 comments
Open

RCS0036 without GenerateDocumentationFile shows error #1608

curcas opened this issue Jan 17, 2025 · 2 comments

Comments

@curcas
Copy link

curcas commented Jan 17, 2025

Having a project without GenerateDocumentationFile property set to true and RCS0036 active shows an error.

Steps to reproduce

  1. Have the GenerateDocumentationFile missing or set to false in the csproj
<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
        <GenerateDocumentationFile>false</GenerateDocumentationFile>
    </PropertyGroup>
</Project>
  1. Have a class with documentation on the properties
/// <summary>
/// Test
/// </summary>
public class TestClass
{
    /// <summary>
    /// Create instance
    /// </summary>
    public TestClass(string p1, string p2)
    {
        P1 = p1;
        P2 = p2;
    }

    /// <summary>
    /// P1
    /// </summary>
    public string P1 { get; }

    /// <summary>
    /// P2
    /// </summary>
    public string P2 { get; }
}
  1. Build and see the error
error RCS0036: Remove blank line between single-line declarations of same kind
@josefpihrt
Copy link
Collaborator

@curcas I was not able to reproduce this bug. Afaik RCS0036 has nothing to do with GenerateDocumentationFile.

Where exactly in your code sample is the diagnostic reported?

@curcas
Copy link
Author

curcas commented Feb 17, 2025

Hi @josefpihrt

The error is on the empty line before the documentation comment for P2.

I created a test project here: https://github.com/curcas/roslynator-rcs0036
You just need to run "dotnet build" in the root folder and you'll get the following error:

PS C:\development\roslynator-rcs0036> dotnet build
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\development\roslynator-rcs0036\src\RoslynatorBug.Library\Class1.cs(21,1): error RCS0036: Remove blank line between s
ingle-line declarations of same kind (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0036) [C:\development\r
oslynator-rcs0036\src\RoslynatorBug.Library\RoslynatorBug.Library.csproj]

Build FAILED.

C:\development\roslynator-rcs0036\src\RoslynatorBug.Library\Class1.cs(21,1): error RCS0036: Remove blank line between s
ingle-line declarations of same kind (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0036) [C:\development\r
oslynator-rcs0036\src\RoslynatorBug.Library\RoslynatorBug.Library.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.78

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

No branches or pull requests

2 participants