
The formatting rules can also be applied to the existing code in the current selection, current file, or in a larger scope up to the entire solution. These rules are applied when ReSharper produces new code with code completion and code generation features, applies code templates and performs refactorings. You can configure every detail of formatting rules and enforce the rules in your code. The extensive set of ReSharper code formatting rules has a default configuration that takes into account default Visual Studio formatting options as well as numerous best practices.

Managing and applying code formatting rulesĪn important aspect of code style is how to format the code, that is, how to use whitespaces, tabs, and line breaks to arrange code elements, whether and how to use tabs for indents, whether and how to wrap long lines, and so on. Among other things, this mechanism allows you to maintain different preferences for different solutions as well as to keep these preferences under a VCS and automatically share them with your team members. Your code style preferences are saved using the mechanism of layer-based settings. Note that built-in code cleanup profiles do not include some C++ specific tasks, so you need to create a new custom profile to enable them. Similarly to other languages, all C++ code style preferences can be applied in the desired scope with a single command using either Fix in scope or Code cleanup. The code style, which includes naming standards, formatting rules, and many other tiny aspects can be configured to a very detailed level and shared across your team.

Being tightly interwoven with the majority of other ReSharper's features, they help you produce code and change existing codebases according to the specific code style.

ReSharper provides a lot of features for keeping your code neat and clean.
