Commit 컨벤션에 맞게 자동으로 질의 응답 형식으로 commit 메세지를 만들어주는 툴. interactive한게 오히려 귀찮을 수 있으므로 초반 컨벤션에 익숙하지 않은 사람에게 추천.

‣

document

설치

pip install Commitizen

사용

초기화 및 설정 파일 생성: 특정 파일에 last tag, tag format등의 정보가 저장된다.

cz init

아래 명령어를 치면 몇 가지 질문이 뜨는데, 잘 따라가면 알아서 메세지를 만들고 커밋까지 해줌

cz commit
# 짧은 버전
cz c

changelog 자동 생성

cz changelog

changelog

cz bump --changelog

규약

아래 규약에 맞춰서 commit 메세지를 작성하면 changelog에 해당 commit들이 포함된다. 반면에 아래 규약을 맞춰 작성하지 않으면 불포함된다.

fix: A bug fix. Correlates with PATCH in SemVer
feat: A new feature. Correlates with MINOR in SemVer
docs: Documentation only changes
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor: A code change that neither fixes a bug nor adds a feature
perf: A code change that improves performance
test: Adding missing or correcting existing tests
build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)
ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)

Github action

changelog에 있는 버전을 참고하여 Semantic Versioning 규칙에 맞게 증가시켜준 후, 그 버전으로 tag를 만들어준다.

그 전에 pyproject.toml 파일에 설정