intellij, Code Convention 과 Formatter
intellij 에서 Code Convention 을 적용하기 위한 설정을 기록한다. Code Convention 은 Naver 캠퍼스 핵데이 Java 코딩 컨벤션을 사용하기로 했다.
캠퍼스 핵데이 Java 코딩 컨벤션

1. Code Style, Formatter 설정
아래 주소의 naver-intellij-formatter.xml 를 다운로드 받아서 Import Scheme 에서 로드 한다.
hackday-conventions-java/rule-config/naver-intellij-formatter.xml at master · naver/hackday-conventions-java
캠퍼스 핵데이 Java 코딩 컨벤션. Contribute to naver/hackday-conventions-java development by creating an account on GitHub.
naver-intellij-formatter.xml

2. Check Style, Tools 설치 및 설정
1) Plug In 설치

2) Tools 설정
hackday-conventions-java/rule-config/naver-checkstyle-rules.xml at master · naver/hackday-conventions-java
캠퍼스 핵데이 Java 코딩 컨벤션. Contribute to naver/hackday-conventions-java development by creating an account on GitHub.
naver-checkstyle-rules.xml
hackday-conventions-java/rule-config/naver-checkstyle-suppressions.xml at master · naver/hackday-conventions-java
캠퍼스 핵데이 Java 코딩 컨벤션. Contribute to naver/hackday-conventions-java development by creating an account on GitHub.
naver-checkstyle-suppressions.xml
위 두 파일을 다운로드 하고 아래와 같이 설정한다.
왼쪽 Tools > Checkstyle 을 선택하고, Configuration File 에서 + 를 눌러서 Description 에 간단히 설명을 넣도록 하고 다운로드 한 naver-checkstyle-rules.xml 파일을 Browse 해서 가져온다.


그 다음에 나오는 Property 설정화면의 suppressionFile 설정에 동일한 경로에 있는 naver-checkstyle-suppressions.xml 파일명을 입력하고 마무리 한다.


3. 기타 설정
1) Save 설정
Save시 Code 를 설정한 Format 으로 수정하거나 import 문을 정리하는 기능들을 설정했다.

2) Commit 설정
Commit 할때 Code 를 한번 정리하도록 할 수도 있다.
