Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolved #4
AS-IS
그동안 직접 개발자가 ktlintCheck를 통하여 위반 사항을 체크하였습니다.
하지만 설정에 따라 제대로 코드 검사가 안되는 경우도 있습니다.
TO-BE
GithubAction을 활용하여 Ktlint 포메팅 검사와 작성한 유닛 테스트 통과 여부를 검사합니다.
KEY-POINT
그동안 test framework를
junit
만 사용해서 추후 사용 예정인kotest
와 충돌나지 않을까 걱정하였는데,다른 프로젝트로 CI + Kotest가 정상 작동하는 것을 확인하였습니다.
추후 프로젝트 규모가 커져 슬랙을 사용한다면 CI와 연동하여 결과를 메시지로 받아볼 수 있게 할 수도 있습니다.
한 가지 걱정되는건 오류가 있을 때 프로젝트에 존재하는 오류를 병렬적으로 전부 표시하는게 아닌 한 번의 CI 작동에 한 가지의 오류만을 체킹하고 결과로 알려줍니다.
여러 가지의 잘못된 사항이 있다면 그 개수 만큼 CI를 돌려야하는 상황입니다.
하지만 개발할 때
addKtlintCheckGitPrecommitHook
을 제대로 실행 해두면 실질적으로 오류가 그렇게까지 크게 많이 있진 않을거 같습니다.일단은 사용해보고 추후 이런 케이스가 오히려 생산성을 저하 시킨다면 다른 방법을 강구해보는게 좋을 것 같습니다.
대체제로 ScaCap의 Action-Ktlint을 사용하는 것도 방법일 것 같습니다.
SCREENSHOT (Optional)
Ktlint 규칙을 어겼을 때
테스트코드가 실패했을 때