-
Code Style, Check Style 적용Tool/IntelliJ 2024. 5. 2. 11:04
1. Code Style 적용 (formatter)
1.1. formatter import 적용
Settings -> Editor -> Code Style -> Java -> 톱니바퀴 -> Import Scheme -> IntelliJ IDEA code style XML -> xml 선택 -> OK -> Apply 1.2. 작동 확인
Window : Ctrl + Alt + L Mac : Command + Option + L
1.3. 기타 설정
저장 할때마다 포멧 적용되도록 하기
Settings -> Tools -> Actions on Save -> Reformat code xml 붙혀넣기 했을때 포멧팅 되는 기능 제거
Settings -> Editor -> General -> Smart Keys -> Reformat on paste -> None 2. Check Style 적용
2.1. Check Style Plugin 설치
Settings -> Plugins -> `CheckStyle` 검색 -> Install -> IDEA 재시작 2.2. Check Style 설정
IntelliJ IDEA를 재시작하고 Settings -> Tools로 이동하게 되면 Checkstyle이 추가되어있다.
2.3. 추가한 Checks 선택 후 Apply
2.4. 작용 확인
IntelliJ IDEA 하단에 CheckStyle 탭 클릭하면 아래와 같이 뜨고 초록색 재생버튼을 누르게 되면 아래와 같이 Checkstyle에 맞지 않는 부분이 경고로 표시된다.
'Tool > IntelliJ' 카테고리의 다른 글
IntelliJ 에서 Java main함수 실행하는 방법 (0) 2024.06.11 IntelliJ에서 settings 초기화 (0) 2024.05.03 IntelliJ CE JDK, 모듈 설정 및 서비스 추가 (0) 2024.04.09 IntelliJ/mariaDB Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb4_unicode_ci,COERCIBLE) for operation 'like' (0) 2023.02.08 IntelliJ/MyBatis 경고 설정 (코드 검사 및 포멧팅) (0) 2022.11.02