Inspections does not honor settings
I am getting warnings that the name of my Instance fields does not match the rule.
However when I check the rule, it says it should be _lowerCamelCase which matches my code style. (Changing "Enable ‘Inconsistent Naming’ inspection, ‘Enable inspection’ and 'Use auto-detected values does nothing).
There are no settings for 'Instance fields' in my EditorConfig file. (Or any other rules about Naming…)
Does anyone know what is going on here? It has worked fine previously (2023)
Please sign in to leave a comment.
Hello Viktor Lindblom,
Could you attach a screenshot of the Code Style Configuration window? You can invoke Show Code Style Configuration action from Search Everywhere to show this window.
Hello, here it is:
I turned Autodetection back on from the previous screenshots
Thank you for the screenshot. Would you mind expanding the first Global AnalyzerConfig node - does it contain any naming rules?
Sure no problem. But I don't think there are any:
Thank you for the information.
Could you check if StyleCop support is enabled in the affected IDE instance? You can find Enable StyleCop support setting under Editor→Code Style
Stylecop is on. Turning it off made the errors go away for a few seconds after restarting rider, but probably just due to reanalyzing the files
Thank you for the information Viktor Lindblom. Would you be comfortable sharing your .editorconfig with us along with your Rider logs (Help→Collect Logs) so we can investigate this further?
You can send us the logs via the Upload Service and leave the Upload ID in this thread.
Sure, my upload id is 2024_02_20_z1JvwGQuHZULvZZwdgSmnT, both .editorconfig and logs are supplied
Kirill Filin Not sure if this helps, but adding:
// ReSharper disable once InconsistentNaming
private readonly IMediator _mediator;
stops rider from complaining. So is it something with ReSharper maybe?
Found the issue, a duplicate [*.cs] tag in the .editorconfig was the error