Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xixixao/xcode-file-templates

XCode 4 File Templates compliant with the Google Objective-C Style Guide.
https://github.com/xixixao/xcode-file-templates

Last synced: 19 days ago
JSON representation

XCode 4 File Templates compliant with the Google Objective-C Style Guide.

Awesome Lists containing this project

README

        

Xcode File Templates - Guidelines Compliant
===========================================

Xcode 4 File Templates compliant with the Google Objective-C Style Guide.

Introduction
------------

Xcode 4 provides template files (used when creating a new file or adding code,
f.e. by linking a new outlet or action) which are not compliant with the
[Google Objective-C Style Guide](http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml),
most notably, they use 4 spaces for tabs and open brackets on new lines.
This might cause unexpected behavior in
Xcode, which won't follow your custom indentation settings.

The included templates use **2 spaces** for indentation
and put **opening brackets on the same line** as declarations.

Installation
------------
Simply clone this repository into

~/Library/Developer/Xcode/Templates/File Templates

or in case you already have custom templates, clone this repo anywhere
on your disk and then copy files from there into the given path.

In case you're using Finder and can't find /Library,
you will need to unhide it:

chflags nohidden ~/Library

Tools
-----
In case you already have files with brackets on new lines, you can run
this PERL command line script

perl -0777 -pi -w -e 's/\n{/ {/g;' *.m

which strips the new lines in all .m files in the current directory.

If you have a whole folder structure full of source code formatted
this way, this script

perl -0777 -pi -w -e 's/\n{/ {/g;' `find ./ -name *.m`

will work on current directories and all directories, as long as the
paths don't include any spaces. If you know how to fix this, let me
know.

Errors
------
If you encounter an error or code that doesn't comply with the Style Guide,
send me a pull request or pop an email.