Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fix indentation for entire project in Xcode 7?

I've inherited a huge iOS project which is all using two-space indenting. I need that to be four-space indenting. I know that I can hit Ctrl+I per file, but I'm wondering whether Xcode (or AppCode, for that matter) has a means of re-indenting every source file in the entire project in one whack.

Failing that, I’m wondering how I might go about writing some sort of script (using Automator, or perhaps an Xcode plugin, or even something on the command line) to achieve this without going insane.

like image 857
Luke Avatar asked Mar 13 '23 22:03

Luke


1 Answers

You can use SwiftFormat to make indentation on all of your project .swift files

$ brew install swiftformat
$ cd <path to your project>
$ swiftformat .
like image 172
Ivan Besarab Avatar answered Mar 29 '23 06:03

Ivan Besarab