이전에는 Google Java Style guide에 진행했습니다. 이번에 git에 commit을 하려고 했는데
git commit도 따로 스타일이 있지 않을까 해서 찾아보다. 있어서 작성합니다.
Commit 메세지
1. 메세지 구조
크게 3가지로 나눌 수 있다. title, body, footer
type: Subject
body
footer
2. The Type
- feat: 새로운 기능 추가시 사용
- fix: 기능 버그
- docs: 문서 추가 및 변경했을 때
- style: UI를 추가/변경했을 때
- refactor: 코드 자체를 리팩토링 했을때
- test: 테스트 코드를 별도로 추가하거나 변경, 테스트 코드를 리팩토링했을 때
- chore: 빌드 작업이나 패캐지 관리자 구성 등 업데이트, 프로덕션 코드 변경 없을 때
3. The Subject
- 제목은 50자 이내
- 명령형 어조 사용하여 커밋, 수행하는 작업을 설명가능해야 한다.
- 마지막에 마침표(.)를 찍지 않는다.
4. The Body
- 하나의 선택사항
- 약간의 설명이 필요할 경우에만 사용
- Body를 사용하여 내용과 이유를 설명한다.
5. The Footer
- 하나의 선택사항
- Issue tracker ID를 참조하는데 사용한다.
예제
feat: Summarize changes in around 50 characters or less
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like log, shortlog
and rebase can get confused if you run the two together.
Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
If you use an issue tracker, put references to them at the bottom,
like this:
Resolves: #123
See also: #456, #789
참고문헌
Udacity Nanodegree Style Guide
Udacity Nanodegree Style Guide
Introduction This style guide acts as the official guide to follow in your projects. Udacity evaluators will use this guide to grade your projects. There are many opinions on the "ideal" style in the world of development. Therefore, in order to reduce the
udacity.github.io