force use of curly braces - how to ?

Hello

I'm refactoring a large code base and there are many instances of single lines statements inside loops and control of flow without the use of 'curly braces'. This makes it hard to read and understand the code. I would like to 'Clean up' the code and get ReSharper to add curly braces everywhere, for if-else, for-loop, etc. Is there a setting like that anywhere. I couldn't find anything. 

Thanks!

5 comments
Comment actions Permalink

Hello,

We don't have this code style settings yet, the feature request is https://youtrack.jetbrains.com/issue/RSCPP-20266. In general, code style cleanup is lacking in C++ compared to C# at the moment, but we plan to improve it.

Thanks!

0
Comment actions Permalink

As per the comment above: In general, code style cleanup is lacking in C++ compared to C# at the moment, but we plan to improve it.-- that was over a year ago - has any progress been made with this.  Mostly I am interested in the curly brace for single lines.  Do you have a time line when you expect to improve the C++ cleanup options

0
Comment actions Permalink

Hello Nathan,

I'm not sure we'll have time for a fully fledged code style settings page, but we can easily add a standalone inspection (turned off by default) for compound statements without braces. I'll try to implement this in 2019.3.

Thanks!

0
Comment actions Permalink

Hi Igor, is this feature implemented yet? I have the 2019.2.3 Resharper version. so I guess not but I would like to keep updated if this released

 

Thank you so much!

0
Comment actions Permalink

Hey,

Sorry, no news to share yet. I'll update this thread when the feature is available.

0

Please sign in to leave a comment.