[ios] How to set up clang formatter
How to set up clang formatter
Step 1:
Install alcatraz (http://alcatraz.io). Alcatraz is a package manager for Xcode.
How to install? Simply run:
curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
Step 2:
In Xcode, go to Window -> Package manager.
Search for clangformat.
Click on the folder/briefcase like icon on the left, to install clangformat plugin.
It installs pretty quickly and it might not tell you that it is installed. Do not tap on the folder/briefcase icon again, it will uninstall the plugin.
Close and re-open the package manager, search for clangformat, folder/briefcase like icon should be blue now. That'd indicate that clangformat plugin is now installed.
Restart Xcode
You can read more about clangformat plugin here: https://github.com/travisjeffery/ClangFormat-Xcode . It is based on clang-format.
Step 3:
In Xcode, go to Edit -> Clang Format. Pick "File".
This will ensure that auto-formatter uses our custom formatting preferences file located at apps/shopkick/iphone/Shopkick/.clang-format and lib/iphone/.clang-format.
We're following a slight variation of LLVM coding style.
Step 4:
In Xcode, go to Edit -> Clang Format. Pick "Enable format on save".
This will auto format your code when you save it.
When you are touching the code that hasn't been auto-formatted before, it is recommended that you auto-format it first and place the diff in a separate commit. Your code reviewer will thank you.
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
781 | Develop | [ios] iOS 앱 아이콘을 만드는 유틸 | hooni | 2015.01.03 | 863 |
780 | Develop | [ios] ViewController Push할 때 애니메이션 효과 | hooni | 2015.10.23 | 866 |
779 | Develop | [git] 쉬운 버전관리 Git 설명 | hooni | 2015.08.18 | 868 |
778 | Develop | [c] RSA 암호화 구현(gmp 라이브러리 활용) | hooni | 2016.10.03 | 876 |
777 | Develop | [js] AngularJS 란? | hooni | 2015.11.26 | 881 |
776 | Develop | [ios] UIWebView에서 로컬에 있는 html 파일 불러오기 | hooni | 2015.02.10 | 885 |
775 | Develop | [ios] APNS에 사용할 인증서 만들기 (KeyChain에 있는 인증서 Export) | hooni | 2015.01.03 | 886 |
774 | Develop | [ios] iOS 8 개발자가 우선 알아야 할 3가지 | hooni | 2014.10.02 | 898 |
773 | Develop | [js] 좋은 강연자료 & UI 자료 | hooni | 2014.10.06 | 905 |
772 | Develop | [android] 딜레이를 구현하기 위한 꼼수 | hooni | 2016.11.24 | 930 |
771 | Develop | [ubuntu] 우분투 18.04에 PHP5 설치하기 | hooni | 2020.11.14 | 934 |
770 | Develop | [ios] Xcode에서 특정 파일만 ARC 따로 설정하는 방법 | hooni | 2017.03.29 | 940 |