StyleCop conflicts with Raider code inspection

I have ASP.NET core project and trying to enable StyleCop.

I added package dotnet add package StyleCop.Analyzers

and it showed warnings when I build the solution. Also in the editor everything was underlined and had explanation why. So far so good.

 

The problem is that when I try to reformat code or perform code cleanup, it ignores StyleCop's rules. Everything stays the same.

To make things worse, if I try to correct it manually it will revert it when I execute code formatter. Also if something is fixed by StyleCop rules, then Rider will complain.

 

I enabled "Read settings from editorconfig, project settings and rule sets" and "Enable StyleCop support".

I am using Rider 2020.1

2
2 comments
Avatar
Permanently deleted user

Same problem here. Did you find a solution?

0

Hello,

Rider is now able to read and apply code style settings only from settings.stylecop files, see this docs page. StyleCop analyzers are not integrated in Code Cleanup in any way. This will be fixed in the scope of RSRP-469244.

We should mention this restriction in Rider docs, I've created a task for that, see RIDER-55131.

2

Please sign in to leave a comment.