timur
January 9, 2020, 3:28pm
1
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?
timur
January 9, 2020, 3:31pm
2
Wait, I finally figured it out. For everyone else’s benefit, this is the relevant setting:
6 Likes
LiamG
January 12, 2020, 9:20am
3
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? Any grep
masters out there?
This can be done using clang-format
@danradix
1 Like
TL;DR: Use the SpaceBeforeParens: NonEmptyParentheses
setting in clang-format which was generously added by @reuk
2 Likes