Visual Studio 2019 and JUCE coding standards

The JUCE coding standards famously say that you should have a whitespace before non-empty parentheses, but no whitespace before empty parentheses:

f();
g (0.5);

However, when typing code like above, I can’t figure out how to teach Visual Studio 2019 to not auto-format my whitespace all the time!

What’s the combination of tickboxes that I have to use so that VS lets me type code like above?

Wait, I finally figured it out. For everyone else’s benefit, this is the relevant setting:

6 Likes

Good to know! Now does anybody have a lead on how to go about retrospectively fixing the spacing in a million and one places throughout a project? :grimacing: Any grep masters out there?

This can be done using clang-format @danradix

1 Like
3 Likes

TL;DR: Use the SpaceBeforeParens: NonEmptyParentheses setting in clang-format which was generously added by @reuk

2 Likes