[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.
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
433 | Develop | [js] 네이버에서 그림 퍼올 때.. URL Encoding 관련ㅋㅋ | hooni | 2013.04.23 | 7245 |
432 | Develop | [linux] 날짜나 파일의 내용으로 검색하는 방법(find 명령 사용) | hooni | 2013.04.23 | 8156 |
431 | Develop | [c++] 현승이가 준 메신저 소스.. ㅋㅋ | hooni | 2013.04.23 | 8299 |
430 | Develop | [c] 아파치 모듈(Apache Module) 만들기 | hooni | 2013.04.23 | 8627 |
429 | Develop | [c++] MFC로 만든 디렉토리/파일 파인더 | hooni | 2013.04.23 | 9367 |
428 | Develop | [c++] 데이터 압축 프로그램 소스 (lzw) | hooni | 2013.04.23 | 9971 |
427 | Develop | [c++] 압축프로그램(Lite Zip) 샘플 | hooni | 2013.04.23 | 8631 |
426 | Develop | [c#] HTML 이벤트 샘플 소스.. | hooni | 2013.04.23 | 7786 |
425 | Develop | [c++] 중복실행 방지(Mutex;뮤텍스 ) 샘플 소스.. ㅋㅋ | hooni | 2013.04.23 | 8767 |
424 | Develop | [c#] 툴바 현재 욜심히 만들고 있는거.. 백업용.. ㅋㅋ | hooni | 2013.04.23 | 2852 |
423 | Develop | [c#] 툴바 최근 버전(IE6, IE7 두가지 버전) | hooni | 2013.04.23 | 2138 |
422 | Develop | [c] 시간(요일,날짜 포함) 출력하는 프로그램 초간단 코드 | hooni | 2013.04.23 | 7423 |