Skip to content

Commit fc06eae

Browse files
author
R0n0066
committed
update (readme): Add configurations to readme
1 parent 8185965 commit fc06eae

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

Readme.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ CMF is a simple to use utility to standarize commit messages on projects.
66

77
Install via npm, just do `$ npm install -g go-cmf`
88

9+
Or from Go `go install github.com/walmartdigital/commit-message-formatter`
10+
911
Once installed, go to your project an run `$ cmf` after add your files to your stage area.
1012

1113
## Flows
@@ -27,3 +29,105 @@ Running `$ cmf jira` you get jira flow, this time you will be prompt for:
2729
- Jira task ID
2830
- Type of change you made to your code
2931
- Commit message or description of your change
32+
33+
> If you want to do jira as a defualt flow just create a `.cmf.yaml`in the root of your project:
34+
35+
```
36+
DEFAULT: jira
37+
```
38+
39+
---
40+
41+
## Configurations
42+
43+
It is possible to config CMF as you like, you can change **custom flows, templates or assign default flows**. You can do this using a local file on the root of your porject or setting as global preferences with a file on your Home directory called `.cmf.yaml`.
44+
45+
### DEFAULT
46+
47+
Set a flow as default:
48+
49+
```
50+
DEFAULT: jira
51+
```
52+
53+
### TEMPLATE
54+
55+
Set a template string for commit messages.
56+
57+
#### Default flow
58+
59+
Default template `{{CHANGE}}({{MODULE}}): {{MESSAGE}}`. You can use this variables:
60+
61+
- CHANGE _type of change: feature, fix, update_
62+
- MODULE _module affected_
63+
- MESSAGE _commit message_
64+
65+
```
66+
TEMPLATE: "{{CHANGE}}({{MODULE}}): {{MESSAGE}}"
67+
```
68+
69+
#### Jira flow
70+
71+
Default template `{{JIRA-TASK}} ({{CHANGE}}): {{MESSAGE}}`. You can use this variables:
72+
73+
- JIRA*TASK \_jira task id*
74+
- CHANGE _type of change: feature, fix, update_
75+
- MESSAGE _commit message_
76+
77+
```
78+
TEMPLATE: "{{JIRA-TASK}} ({{CHANGE}}): {{MESSAGE}}"
79+
```
80+
81+
### PROMPT
82+
83+
You can create your custom flows using this configuration attribute.
84+
85+
Prompt accept two types of prompts:
86+
87+
- Single question:
88+
- KEY _variable name_
89+
- LABEL _prompt title_
90+
- Select:
91+
- KEY _variable name_
92+
- LABEL _prompt title_
93+
- OPTIONS _list of options_
94+
- VALUE _variable value_
95+
- DESC _variable description_
96+
97+
_default .cmf.yaml sample file_
98+
99+
```
100+
PROMPT:
101+
- KEY: "CHANGE"
102+
LABEL: "Select the type of change:"
103+
OPTIONS:
104+
- VALUE: "feature"
105+
DESC: "A new feature"
106+
- VALUE: "fix"
107+
DESC: "A Bug fix"
108+
- VALUE: "update"
109+
DESC: "An update code change (moving or split code)"
110+
- VALUE: "docs"
111+
DESC: "Documentation only changes"
112+
- VALUE: "style"
113+
DESC: "Small changes of code style"
114+
- VALUE: "test"
115+
DESC: "Add, change or update test code"
116+
- KEY: "MODULE"
117+
LABEL: "Affected module:"
118+
- KEY: "MESSAGE"
119+
LABEL: "Commit message:"
120+
TEMPLATE: "{{CHANGE}}({{MODULE}}): {{MESSAGE}}"
121+
```
122+
123+
---
124+
125+
Contributions
126+
Use GitHub issues for requests.
127+
128+
I actively welcome pull requests; learn how to contribute.
129+
130+
---
131+
132+
License
133+
CMF is available under the MIT License.

0 commit comments

Comments
 (0)