코드 컨벤션

📌 줄바꿈, 공백, (콤마· 조건문 혹은 메서드 괄호 위치) 등등

띄어쓰기, 들여쓰기 등등

ctrl + alt + l

팀원 모두가 IntelliJ의, 위 단축키를 활용해서 통일성을 지킨다.

. 을 사용하는 메서드의 경우 줄바꿈

.으로 이어지는, 메서드의 경우 . 을 기준으로 줄바꿈을 한다.

// Good Examples
Post post = Post.builder()
                .title(request.getTitle())
                .build();

//Bad Examples
Post post = Post.builder().title(request.getTitle()).build();

// Good Examples
when(postRepository.save(any()))
                    .thenReturn(mockPost);

//Bad Examples
when(postRepository.save(any())).thenReturn(mockPost);

변수 선언

// Good Examples
int a;
int b;

// Bad Examples
int a, b;

📌 명명 규칙