DevOps
JetBrains IntelliJ Google Style Linter 적용하기
맑은안개
2023. 6. 25. 10:28
Google Style Linter 적용하기
1. IntelliJ에 구글스타일 린터를 적용하기 위해서 아래 링크로 접속하여 스타일정의 포맷(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
2. IntelliJ에 적용하기
- Scheme > Import Scheme > 다운로드한 xml 선택
- Ctrl + Alt + L 숏컷으로 코드스타일 적용
- Tab Size, Indent를 4로 적용한다.
2. 프로젝트에 일괄 Lint 적용하기
아래와 같이 src 디렉토리 우클릭 후 "Reformat Code" 선택
3. 저장 시 자동 적용하기 ( Automatically reformat code on save )
- Settings > Tools > Actions on Save
- Reformat code 체크 ( Changed lines - 변경된 라인만 적용 )
반응형