Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong><em>updated April 2013</em></strong></p> <p>As Roger Nolan and rcw3 suggested, you can go a lot further with <a href="http://uncrustify.sourceforge.net" rel="noreferrer">Uncrustify</a>. The latest release version can be download <a href="http://sourceforge.net/projects/uncrustify/files/uncrustify/" rel="noreferrer">here</a>.</p> <hr> <h2>Integration Into Xcode</h2> <p>Integration into Xcode is dependent upon the version of Xcode that is installed.</p> <ul> <li><strong>Xcode 4.6 &amp; newer</strong></li> </ul> <p>Benoît Bourdon's <a href="https://github.com/benoitsan/BBUncrustifyPlugin-Xcode" rel="noreferrer">BBUncrustifyPlugin-Xcode</a></p> <p>This plugin provides access to Uncrustify right from Xcode's "Edit" menu ("Uncrustify Selected Files", "Uncrustify Active File", and "Uncrustify Selected Lines"). Just build the project and the plugin is compiled and installed.</p> <p>As of April 2, 2013, Uncrustify 0.60 and an Uncrustify configuration file are include with the plugin. To use a custom Uncrustify configuration file, make sure to read the section titled "How to customize the Uncrustify configuration?" of <a href="https://github.com/benoitsan/BBUncrustifyPlugin-Xcode/blob/master/README.md" rel="noreferrer">README.md</a>.</p> <p><em>Note: To use Uncrustify from the command line, for example as part of a git hook, I recommend building and installing <a href="http://sourceforge.net/projects/uncrustify/files/uncrustify/" rel="noreferrer">Uncrustify</a> independently. For consistency sake, I also recommend replacing the version of Uncrustify that comes with the plugin with a link to the version Uncrustify that was independently built and installed. The following is how to do that:</em> </p> <pre><code>cd ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/UncrustifyPlugin.xcplugin/Contents/Resources mv uncrustify uncrustify.orig ln -s /usr/local/bin/uncrustify uncrustify </code></pre> <ul> <li><strong>Xcode 4.x</strong></li> </ul> <p>Jonah Williams' <a href="http://blog.carbonfive.com/2011/03/10/code-formatting-in-xcode-4/" rel="noreferrer">Code Formatting in Xcode 4</a></p> <ul> <li><strong>Xcode 3.x</strong></li> </ul> <p>Jonah Williams' <a href="http://blog.carbonfive.com/2009/08/07/code-formatting-in-xcode/" rel="noreferrer">Code Formatting in Xcode</a></p> <hr> <h2>Example Uncrustify Configuration File</h2> <p>The Uncrustify 0.60 configuration file that I use for Objective-C is located <a href="https://gist.github.com/m2orris/5297267" rel="noreferrer">here</a>.</p> <hr> <h2>Update the Uncrustify Configuration File for a New Version of Uncrustify</h2> <p>To update the Uncrustify configuration file for a new version of Uncrustify, start a Terminal and type:</p> <pre><code>mv uncrustify.cfg uncrustify.cfg.old uncrustify -c uncrustify.cfg.old --update-config &gt; uncrustify.cfg </code></pre> <p>To see the changes made to the Uncrustify configuration, in the terminal type:</p> <pre><code>diff uncrustify.cfg.old uncrustify.cfg </code></pre> <hr> <h2>To View a Documented Version of the Uncrustify Configuration File</h2> <p>To view a documented version of the Uncrustify configuration file, start a Terminal and type:</p> <pre><code>uncrustify -c uncrustify.cfg --show-config </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload