How do I install uncrustify?

How do I install uncrustify? I followed the instruction to install uncrustify but when I run it, it does not work. Can anyone give me some help installing this tool? I want to run it on objective-c code in xcode 4. Thanks in adavance

Answers

On OS X Mavericks 10.9.1 :

1- to install brew, open a terminal windows and type :

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

It will ask you to download some other files, answer OK for all (for more information see : http://brew.sh/index_fr.html).

2 - to install uncrusify, open a terminal windows an type :

brew install uncrustify

3 - to make your code beautiful, download BBUncrustifyPlugin-Xcode available at https://github.com/benoitsan/BBUncrustifyPlugin-Xcode

You will just have to :

  • compile the project
  • copy the file uncrusify.cfg in your home directory
  • restart Xcode.

NB : With BBUncrustifyPlugin, you don't need to use Automator.

4 - After restarting Xcode, use the menu Edit > Uncrustify Selected Files to uncrustify the selected items in the project navigator.

Your code is now beautiful! That's magic!

post-scriptum : You can easily change your uncrusify configuration file by using :

I hope that this will help!

Posted on by Chrstpsln