Tool/IntelliJ

IntelliJ/CheckStyle 및 GoogleStyle Formatter 설정

건담아빠 2022. 10. 20. 08:28

 

CheckStyle 설정

CheckStyle 설치 후 IDE Restart

⌘ + ,

 

Check Style을 Google Checks로 변경

 

GoogleStyle Formatter 설정

아래 사이트는 구글 스타일에 대한 컨벤션 규칙임으로 참고 바람

https://google.github.io/styleguide/javaguide.html

 

Google Java Style Guide

1 Introduction This document serves as the complete definition of Google's coding standards for source code in the Java™ Programming Language. A Java source file is described as being in Google Style if and only if it adheres to the rules herein. Like ot

google.github.io

 

각자의 방법으로 아래사이트에서 `intellij-java-google-style.xml`파일을 다운로드 한다. (저같은 경우에는 압축파일 전체 받음)

https://github.com/google/styleguide

 

GitHub - google/styleguide: Style guides for Google-originated open-source projects

Style guides for Google-originated open-source projects - GitHub - google/styleguide: Style guides for Google-originated open-source projects

github.com

 

에디터 > 코드 스타일 로 이동하여 IntelliJ IDEA 코드 스타일 XML을 Import 한다.

 

GoogleStyle Import

 

변경이 필요한 컨벤션 설정

 

CheckStyle 관련 부분은 1차적으로 참조만 하고, Formatter 부분만 주로 사용해보고 노하우가 쌓이면 나머지 내용들도 보강해 나가는 식으로 진행하자!!

 

 

코드자동 정렬을 해야 코딩 스타일이 적용된다.(단축키 아래 URL 참조) 코딩컨벤션에 대한 논의 후 정리가 된다면 저장과 동시에 포멧팅이 되도록 할 예정이다.!

https://dchkang83.tistory.com/83

 

IntelliJ/단축키 모음

기본 ⇧ : Shift ⌃ : Controll ⌥ : Option ⌘ : Command Home : fn + ← End : fn + → Page Up : fn + ↑ Page Down : fn + ↓ 단축키 구분 맥 연결 키보드 맥 윈도우 Comment 코드..

dchkang83.tistory.com

 

 

참조)

https://djlee118.tistory.com/430

 

코드 컨벤션 설정 checkstyle과 formatter 깔끔하게 정리하기(feat. intelliJ)

블로그 목적  - 코드 컨벤션 설정관련 checkstyle과 formatter 에 대한 내용을 정리 및 공유한다. 블로그 요약 - 하나,코드 컨벤션 설정을 위한 checkstyle과 formatter 에 대해서 알아본다. - 둘, 인텔리제

djlee118.tistory.com

https://055055.tistory.com/97

 

인텔리제이 코딩 컨벤션 설정

코딩 컨벤션(코드 컨벤션) Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program writ..

055055.tistory.com

https://juneyr.dev/checkstyle

 

intelliJ, Checkstyle 과 formatter 셋업하기

서론 혼자만의 프로젝트든, 함께하는 프로젝트든, 기본적인 코드컨벤션이 있다면 코드의 가독성은 확 높아집니다. 그런데 이런 코드 컨벤션을 세워도, 매번 기억하거나 유의하기 어려울 때도

juneyr.dev