Using StyleCop Styles
To apply StyleCop rules, JetBrains Rider relies on its own features and settings, which do not always map directly onto StyleCop rules:
- JetBrains Rider supports most of StyleCop naming, maintainability, readability, and layout rules.
- Some StyleCop rules may not be supported in a specific version of JetBrains Rider. However we will try to support more rules in coming versions.
Inspections for StyleCop rules
JetBrains Rider provides a number of code inspections for formatting and syntax style rules. These inspections do not find all code style problems that StyleCop finds, but they also can find some other problems that StyleCop cannot find, such as indenting problems.
As of version 2018.1, formatter inspections are disabled by default, but they will be automatically activated as soon as you enable StyleCop settings, and will offer you quick-fixes for code issues to automatically correct detected problems.
Applying settings from settings.stylecop files
By default, JetBrains Rider does not read settings from settings.stylecop files. To start taking these settings into account, enable Read settings from editorconfig and project settings on the page of JetBrains Rider settings (Ctrl+Alt+S) and Enable StyleCop support on the page of JetBrains Rider settings.
If you use EditorConfig and StyleCop configuration files simultaneously, the EditorConfig settings will always take precedence over both StyleCop and JetBrains Rider settings. This means that if settings from settings.stylecop do not give desired results for some reason, you can always override specific settings using EditorConfig properties.
Yet another way to apply StyleCop rules in your code is by using StyleCop Analyzers for the .NET Compiler Platform instead of StyleCop. To harness these analyzers, enable the .NET compiler platform analyzers in JetBrains Rider and then install the corresponding analyzer package.