A CLI to step you through creating a formatted git commit message based on the files that you have staged, using the format type(scope): message
, e.g., feat(UsersModel): add "lastLogin" property
.
DIGCM uses velociraptor as a script runner. Run vr
to see available scripts.
The -n
value is the name of the command that will be installed as, so you can change this to an abbreviation that suits you.
deno install --allow-read --allow-run --unstable -n digcm https://raw.githubusercontent.com/jwhitmarsh/deno-interactive-commit/master/cli.ts
allow-read: to read config files
allow-run: to run git commands (status, commit)
unstable: required to run cliffy (CLI library) and deno stdlib
(f)eat
(F)ix
(c)hore
(r)efactor
(s)tyle
(b)uild
(d)ocs
Config should be stored in a .digcm.{json,yaml,yml,toml}
file.
Define transformations for the scope
part of the message. This allows you to include parent directories and change the case.
Prop | Value |
---|---|
test | RegEx used to match files |
includeParentDirs | Number of parent directory names to include |
transformCase | Case transformation to apply |
This parser would convert /src/api/users/model.ts
to UsersModel
{
"scopeFormatters": [
{
"test": "model",
"includeParentDirs": 1,
"transformCase": "pascal"
}
]
}
Define a dictionary of shortcuts for setting the commit type. This will extend and override the default shortcuts.
Prop | Value |
---|---|
shortcuts | Dictionary of shortcut -> resolved type |
This configuration would add the shortcut "c" that resolves to "customType"
{
"shortcuts": {
"c": "customType"
}
}
- add more tests
- extend config to allow more
scopeParser
options