Reputation: 4961
How to customize Eclipse CDT to use Ratliff style for auto formatting?
Ratliff Style of formating code indents the terminating brace to the same level as the contents of the block:
for (i = 0; i < 10; i++) {
if (i % 2 == 0) {
doSomething(i);
}
else {
doSomethingElse(i);
}
}
Eclipse CDT allows a number of common styles to be selected for auto formatting. Ratliff is not in the list but you can modify them to meet your specific requirements:
except there is no option in the list of choices to have the end brace align with the block contents:
Upvotes: 1
Views: 196
Reputation: 52799
No one has implemented this option in CDT's formatter.
CDT is open source, you're welcome to contribute a patch that implements it.
However, given how little CDT's formatter is maintained in general these days, a better use of your time might be to contribute support for the Ratcliff style to clang-format (which also doesn't currently support it, as far as I can tell), and use clang-format in CDT via a plugin like CppStyle.
Upvotes: 1