[git] AngularJS Commit Convention 정리

부침개는 맛있다.·2021년 11월 30일
0

우테코에서 알려준 가이드는 AngularJS Commit Convention이다. 그러나...나는 이걸 하나하나 훑어보기엔 영어실력이 나쁘다... 시간도 오래걸리고...
그래서 다른분들의 블로그와 포스팅들을 참고하여 정리하려고한다.

Commit Message Structure 구조

기본적으로 아래처럼 subject , body , footer

즉 제목/본문/꼬리말로 구성된다. (왼쪽이 본문, 오른쪽이 한글로 해석)

⭐주의⭐

  • 제목/본문/꼬리말 사이의 빈줄.
  • 한줄에 100자 제한. (시인성을 위하여)
  • 제목은 간결.
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

눈에 잘 띄기 위해 한글로 하면 아래와 같다.

<종류>(<scope>): <제목>

<본문>

<꼬리말>

Commit Type

위 예시에서 부분에 들어갈 수 있는것은 아래와 같다.

  1. feat: 새로운 기능 추가
  2. fix: 버그 수정
  3. docs: 문서 수정
  4. style: 코드 포맷팅, 세미콜론 누락, 코드 변경이 없는경우
  5. refactor: 코드 리팩토링
  6. test: 테스트 코드 or 리펙토링 테스트 코드 추가 시
  7. chore: 빌드 업무수정, 패키지 매니저 수정

Angular 9 규약에서 chore가 삭제되고 buildl, ci, perf가 추가 되었다고한다.
그러나 우테코에서 보내준 링크에는 이전버전을 사용하는 듯하여 새로 추가된 사항에 대해서는 참고를 위해 따로 정리하였다.

Angular 9에서는 chore를 안쓰고 아래 3개가 추가된다.

  • build : 빌드 관련 파일 수정
  • ci : CI 설정 파일 수정 (CI: Continuous Integration, 지속적 통합)
  • perf : 성능 개선

Scope 범위? 위치?

  • 변경된 위치, 변경된 부분은 모두 가능하다.
  • ⭐또한 Scope는 생략 가능하다.⭐

직역하면 범위이고, scope의 의미는 아마 위치인것 같다.

Subject 제목

  • 제목 50자까지, 소문자로 시작하며, 마침표 X.
  • ⭐중요한건 명령어로 작성한다 (과거시제 안됨)⭐
  • ex) "changes" ⇒ "change"

Body 본문

  • 굳이 작성할 필요는 없다
  • 부연 설명이 필요하거나, 커밋의 이유를 설명해야할 경우 작성한다.
    무엇(what)과 (why) vs 어떻게(how)⭐
  • 72자 제한, 제목과 구분을 위한 공백라인 꼭 해줘야함.

Footer 꼬리말

  • 이 또한 선택사항, Body와 같이.
  • issue trakcer id를 작성할 때 사용됨.

ex) Closes #123, #245, #992

IssueTracking에 대한 포스팅 하나. ⇒ 클릭!
"이슈 트래커"라고 검색하였음.

Example 예시

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 consequenses 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

generating CHANGELOG.md

사실 본문에서 옮기지 않은 것 중에 Goals라는 부분이 있다. 이 컨벤션의 목표인데 그중하나가

  • allow generating CHANGELOG.md by script

즉, CHANGLOG.md를 작성하는 것이다. 직역하니 변경내역을 로깅 하는 것이다.

⭐ Changelog.md를 생성하는 법은 [여기](https://github.com/github-changelog-generator/github-changelog-generator)를 참고. 그리고 혹시 모른다면 md는 markdown의 약자이다. (찡긋 내가 몰랐던거다)

변경내역에는 다음 3가지가 포함된다.

  • new feature
  • bug fixes
  • breaking changes

⇒ 새로운 기능

⇒ 버그 수정

⇒ 주요 변경 내용

배포할 때 스크립트를 사용해서 관련커밋에 대한 링크와 함께 위 내용들을 생성 할 수 있다.

물론 실제로 배포하기 전에 변경 내역을 수정하고난 뒤에 배포할 수도 있다.

  • 최근 배포 이후의 제목 목록을 출력하기.
    git log <last tag> HEAD --pretty=format:%s
  • 배포의 새로운 특징들을 출력하기.
    git log <last release> HEAD --grep feature

더 자세한 것을 알고 싶다면 아래 참고에서 outstanding님의 번역본을 보는것을 추천한다!!

참고

참고한 링크 입니다. 정말 감사합니다!

거의 대부분의 내용: bosl95님의 velog

한글로 번역한 내용: outstanding님의 velog

배우는 과정이라 잘못된 정보가 있을 수도 있습니다!! 잘못된 점이 있다면 언제든 알려주세요!!!

profile
저는 됩니다. 할 겁니다.

0개의 댓글