A conventional commits tool
You can download binaries from GitHub Releases Page.
go install github.com/shu-go/git-cx@latest
git cx
First, generate a rule file.
git cx gen
# The default name is .cx.yaml.
# You can give it a name
git cx gen myrule.yaml
Then, edit the file.
headerformat: '{{.type}}{{.scope_with_parens}}{{.bang}}: {{.emoji_unicode}}{{.description}}'
headerformathint: .type, .scope, .scope_with_parens, .bang(if BREAKING CHANGE), .emoji, .emoji_unicode, .description
types:
'# comment1':
desc: 'comment starts with #'
emoji: ""
feat:
desc: A new feature
emoji: ':sparkles:'
fix:
desc: A bug fix
emoji: ':bug:'
:
},
denyemptytype: false
denyadlibtype: false
usebreakingchange: false
Edit your gitconfig (I recommend to use shu-go/git-konfig)
[cx]
scopes = myscopes.yaml
git cx --debug
Type: feat
Scope: hoge
Description: new feature hoge!
Body: (Enter 2 empty lines to finish)
dummy text
----------
feat(hoge): ✨new feature hoge!
dummy text
- gitconfig ([cx] rule={PATH})
- current worktree root
- config directory
- {CONFIG_DIR}/git-cx/.cx.yaml
- Windows: %appdata%\git-cx.cx.yaml
- (see https://cs.opensource.google/go/go/+/go1.17.3:src/os/file.go;l=457)
- exe dir
- .cx.yaml
- Place the yaml in the same location as the executable.