<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Adding a code beautifier script to Xcode</title>
	<atom:link href="http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/</link>
	<description></description>
	<pubDate>Thu, 09 Sep 2010 09:55:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Format you Code with Crustify! &#124; Matching Brackets</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-83</link>
		<dc:creator>Format you Code with Crustify! &#124; Matching Brackets</dc:creator>
		<pubDate>Thu, 06 May 2010 17:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-83</guid>
		<description>[...] Better if you go adjusting your configuration as you go, so let&#8217;s set up and easy way to run Crustify from XCode. I borrow the small script from Scott from HackerToys [...]</description>
		<content:encoded><![CDATA[<p>[...] Better if you go adjusting your configuration as you go, so let&#8217;s set up and easy way to run Crustify from XCode. I borrow the small script from Scott from HackerToys [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Format Your Code With Crustify &#171; www.invasivecode.com</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-82</link>
		<dc:creator>Format Your Code With Crustify &#171; www.invasivecode.com</dc:creator>
		<pubDate>Thu, 06 May 2010 17:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-82</guid>
		<description>[...] go, so let&#8217;s set up and easy way to run Crustify from XCode. I borrow the small script from Scott from HackerToys 1234567#!/bin/sh  echo -n &#34;%%%{PBXSelection}%%%&#34;  /path/to/uncrustify -q -c [...]</description>
		<content:encoded><![CDATA[<p>[...] go, so let&#8217;s set up and easy way to run Crustify from XCode. I borrow the small script from Scott from HackerToys 1234567#!/bin/sh  echo -n &quot;%%%{PBXSelection}%%%&quot;  /path/to/uncrustify -q -c [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego Freniche Brito</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-81</link>
		<dc:creator>Diego Freniche Brito</dc:creator>
		<pubDate>Mon, 19 Apr 2010 15:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-81</guid>
		<description>Very useful! Thanks!</description>
		<content:encoded><![CDATA[<p>Very useful! Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yelp Clone</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-73</link>
		<dc:creator>Yelp Clone</dc:creator>
		<pubDate>Sat, 26 Dec 2009 08:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-73</guid>
		<description>Great Article!  Keep up the good work!</description>
		<content:encoded><![CDATA[<p>Great Article!  Keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-71</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 23 Sep 2009 17:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-71</guid>
		<description>I had some troubles with your script so I wrote a new one.  Maybe this will helps someone out there:


#!/usr/bin/perl -w

use FileHandle;
use File::Temp ("mkdtemp");
use File::Copy ("copy");
use File::Basename ("basename");
use Cwd ("chdir");

my $filename = basename("%%%{PBXFilePath}%%%");
my $temporary_directory = mkdtemp("/tmp/uncrustifyXXXX");

my $uncrustify = "/Applications/UniversalIndentGUI/indenters/uncrustify";
my $config = "/Applications/UniversalIndentGUI/myIndenters/p31Indenter.cfg";

# Write out the file to a temp directory
open(OUTFILE, "&#62; $temporary_directory/uncrustifyMe.m") or die "Unable to create temporary file: $!";
print OUTFILE while();
close(OUTFILE);

chdir("$temporary_directory");

# Write to temp first then read in file and print it
my $output = `$uncrustify -c $config -o output.m -f uncrustifyMe.m`;

# Read in file
open FILE, "&#60; output.m";
$file_contents = do { local $/;  };

# Clean up
unlink "uncrustifyMe.m";
unlink "output.m";
rmdir "$temporary_directory";

print $file_contents;</description>
		<content:encoded><![CDATA[<p>I had some troubles with your script so I wrote a new one.  Maybe this will helps someone out there:</p>
<p>#!/usr/bin/perl -w</p>
<p>use FileHandle;<br />
use File::Temp (&#8221;mkdtemp&#8221;);<br />
use File::Copy (&#8221;copy&#8221;);<br />
use File::Basename (&#8221;basename&#8221;);<br />
use Cwd (&#8221;chdir&#8221;);</p>
<p>my $filename = basename(&#8221;%%%{PBXFilePath}%%%&#8221;);<br />
my $temporary_directory = mkdtemp(&#8221;/tmp/uncrustifyXXXX&#8221;);</p>
<p>my $uncrustify = &#8220;/Applications/UniversalIndentGUI/indenters/uncrustify&#8221;;<br />
my $config = &#8220;/Applications/UniversalIndentGUI/myIndenters/p31Indenter.cfg&#8221;;</p>
<p># Write out the file to a temp directory<br />
open(OUTFILE, &#8220;&gt; $temporary_directory/uncrustifyMe.m&#8221;) or die &#8220;Unable to create temporary file: $!&#8221;;<br />
print OUTFILE while();<br />
close(OUTFILE);</p>
<p>chdir(&#8221;$temporary_directory&#8221;);</p>
<p># Write to temp first then read in file and print it<br />
my $output = `$uncrustify -c $config -o output.m -f uncrustifyMe.m`;</p>
<p># Read in file<br />
open FILE, &#8220;&lt; output.m&#8221;;<br />
$file_contents = do { local $/;  };</p>
<p># Clean up<br />
unlink &#8220;uncrustifyMe.m&#8221;;<br />
unlink &#8220;output.m&#8221;;<br />
rmdir &#8220;$temporary_directory&#8221;;</p>
<p>print $file_contents;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-63</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Sat, 04 Oct 2008 02:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-63</guid>
		<description>Thomas-
I have been playing with UniversalIndentGUI and it does make testing settings really easy.

My biggest problem is the way it handles spaces around colons. The same config that adds or removes spaces to make 1 space before and after colon in this line:

[UIView setAnimationDelegate : self];

Ignores the spacing around the colons in this line:

if (self = [super initWithNibName:nibNameOrNil bundle: nibBundleOrNil])

I've tried playing with the sp_after_send_oc_colon and sp_before_send_oc_colon parameters but they don't seem to do anything.

Overall I'm happy enough with it as it is. The problems are minor and don't prevent anything from compiling. It's still 100x better than just using the built in re-indent.</description>
		<content:encoded><![CDATA[<p>Thomas-<br />
I have been playing with UniversalIndentGUI and it does make testing settings really easy.</p>
<p>My biggest problem is the way it handles spaces around colons. The same config that adds or removes spaces to make 1 space before and after colon in this line:</p>
<p>[UIView setAnimationDelegate : self];</p>
<p>Ignores the spacing around the colons in this line:</p>
<p>if (self = [super initWithNibName:nibNameOrNil bundle: nibBundleOrNil])</p>
<p>I&#8217;ve tried playing with the sp_after_send_oc_colon and sp_before_send_oc_colon parameters but they don&#8217;t seem to do anything.</p>
<p>Overall I&#8217;m happy enough with it as it is. The problems are minor and don&#8217;t prevent anything from compiling. It&#8217;s still 100x better than just using the built in re-indent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://hackertoys.com/2008/09/18/adding-a-code-beautifier-script-to-xcode/#comment-62</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Thu, 02 Oct 2008 18:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://hackertoys.com/?p=56#comment-62</guid>
		<description>If you are still trying to find the best configuration for the Uncrustify code formatting, you may use UniversalIndentGUI for that. It shows you how each of Uncrustifys parameters behaves on the code directly while changing a parameter. You can choose a code file of your choice for that and then save the Uncrustify config file to wherever you want.

Have fun trying it.

   Thomas</description>
		<content:encoded><![CDATA[<p>If you are still trying to find the best configuration for the Uncrustify code formatting, you may use UniversalIndentGUI for that. It shows you how each of Uncrustifys parameters behaves on the code directly while changing a parameter. You can choose a code file of your choice for that and then save the Uncrustify config file to wherever you want.</p>
<p>Have fun trying it.</p>
<p>   Thomas</p>
]]></content:encoded>
	</item>
</channel>
</rss>
