4

I am trying to use Uncrustify but all configurations are breaking my code when working in xcode

std::vector<int> a;

becomes

std: : vector<int> a;

Is there a way to prevent this so that the :: is held together

JamHam
  • 93
  • 1
  • 7
  • 3
    Use a better code prettifier? – Rapptz Apr 10 '13 at 00:04
  • 1
    Why am I being down rated? I want to use uncrustify, I just need to fix this issue. Your comment is very unhelpful. – JamHam Apr 10 '13 at 00:09
  • Well for starters, I didn't downvote you. Second, the comment is basically one of the only solutions because if it can't parse it properly then it won't just magically fix itself unless there are options to modify it greatly, which from what I've seen there aren't. – Rapptz Apr 10 '13 at 00:12
  • Sorry then. I also have astyle, but couldn't find configs for it. Do you know where those might be found of if I should try something else altogether? – JamHam Apr 10 '13 at 00:17
  • Try to build Uncrustify from [latest source](https://github.com/bengardner/uncrustify), and start with default configuration: [default.cfg](https://github.com/bengardner/uncrustify/blob/master/documentation/htdocs/default.cfg), then gradually tweak it to your needs. Personally, I don't have problem like you described, therefore I'm almost sure it should work unless the regression occurred recently. P. S. Nothing to be sorry for, I recommend against listening to people who don't offer neither solutions nor alternatives, but only write pointless comments. – Alexander Shukaev Apr 10 '13 at 18:57

1 Answers1

1

THe reason for this error is that the language was set wrong in the Uncrustify arguments.

Changing -l OC to -l CPP fixed the problem

JamHam
  • 93
  • 1
  • 7