'JetBrains.ReSharper.GlobalTools' - Does not respect `.editorconfig`

I'm trying to use 'JetBrains.ReSharper.GlobalTools' on my CI server to ensure that the commits are of a high standard.
One of the things I would like to enforce is the order of the modifiers.

For that, I do have the following section inside my `.editorconfig` file.

When opening the Solution in Rider, the `.editorconfig` is respected, an no error is flagged.

# Section: Configuration for 'JetBrains.ReSharper.GlobalTools' - Syntax style (Modifiers).
[*.cs]
csharp_default_private_modifier  = explicit
csharp_default_internal_modifier = explicit
csharp_modifiers_order           = public private protected internal static extern new virtual abstract sealed override readonly unsafe volatile async

Rider does respect this (as no issues are showed).

In order to verify that it's working correctly, I changed the `.editorconfig` rule so that `static` needs to come before `public`.
An issue is raised (which means that the `.editoconfig` file is used correctly).

When using the 'JetBrains.ReSharper.GlobalTools' CLI interface, using the command:

dotnet jb inspectcode --build .\Restify.sln --format="Xml" --output="InspectCode.Results.xml"

The resulting XML contains the following:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by JetBrains Inspect Code 2022.1.2 -->
<Report ToolsVersion="221.0.20220601.161751">
<Information>
  <Solution>Restify.sln</Solution>
  <InspectionScope>
    <Element>Solution</Element>
  </InspectionScope>
</Information>
<IssueTypes>
  <IssueType Id="ArrangeModifiersOrder" Category="Syntax Style" CategoryId="CodeStyleIssues" Description="Adjust modifiers declaration order" Severity="WARNING" WikiUrl="https://www.jetbrains.com/resharperplatform/help?Keyword=ArrangeModifiersOrder" />
  </IssueTypes>
<Issues>
  <Project Name="Restify.Modules">
    <Issue TypeId="ArrangeModifiersOrder" File="Modules\Restify.Modules\Extensions\WebApplicationBuilder.Middleware.Extensions.cs" Offset="1941-1954" Line="33" Message="Inconsistent modifiers declaration order" />
  </Project>
</Issues>
</Report>

Is there any reason why the CLI command keeps producing this issue?

Update: Even with a `DotSettings` file, this issue is still reported.

3 comments
Comment actions Permalink

Hello Kevin Dconinck

Do you mean that CLI throws the error despite the editorconfig has the `public` needs to come before `static`?

csharp_modifiers_order           = public private protected internal static extern new virtual abstract sealed override readonly unsafe volatile async
0
Comment actions Permalink

The problem is that, Rider does not flag the issue while the CLI does flag it.

0
Comment actions Permalink

Kevin Dconinck Could you share your solution or its stripped-down version which still triggers the problem? You can send it alongside a support ticket created by the Submit A Request link above.

0

Please sign in to leave a comment.