Skip to content

Commit 8a4305b

Browse files
Rodrigo NavarroRodrigo Navarro
Rodrigo Navarro
authored and
Rodrigo Navarro
committed
docs(readme): refactor readme according to v3 changes
1 parent 776a0d7 commit 8a4305b

File tree

1 file changed

+60
-56
lines changed

1 file changed

+60
-56
lines changed

Readme.md

Lines changed: 60 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,94 @@
1-
# CMF Commit Message Formatter - V2
1+
# CMF Commit Message Formatter - V3
22

3-
CMF is a simple to use utility to standarize commit messages on projects.
3+
CMF is a simple-to-use utility to standarized commit messages on projects.
44

5-
## Getting started
5+
## Migrating from V2
66

7-
Install via npm, just do `$ npm install -g go-cmf`
7+
- Installation via npm command is now deprecated and no longer maintained on **V3**.
8+
- You can still be using your `.cmf.yaml` file. Now you can extend this file with new attributes.
89

9-
Or from Go `go install github.com/walmartdigital/commit-message-formatter`
10+
## Major changes
1011

11-
Once installed, go to your project an run `$ cmf init` and select one of the flows, it will create a `.cmf.yaml`file on your project with your selected flow.
12+
- .cmf.yaml file is no longer required if you want to use a simple flow.
13+
- The default flow of v3 is now strongly forced to use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
14+
- CMF binary is renamed to git-cmf, so now you can use it directly from git as `git cmf` command.
15+
- CMF is now available from Homebrew.
16+
- `cmf init` is cleaner now, it just creates a .cmf.yaml file with
17+
a simple flow to let you customize as you want.
1218

13-
## Flows
19+
## Getting Started
1420

15-
CMF have three flows (for now) default, Jira and custom
21+
### Install CMF
1622

17-
### Default
23+
- Using go install: `go install github.com/walmartdigital/commit-message-formatter`
24+
- Using Brew:
25+
- `brew tap /walmartdigital/homebrew-git-cmf`
26+
- `brew install homebrew-git-cmf`
27+
- Download binaries from Github
1828

19-
Running `$ cmf init` and select default, you will get the default flow and prompted for:
29+
### Initialize project (optional)
2030

21-
- Type of change you made to your code
22-
- Module affected by this change
23-
- Commit message or description of your change
31+
If you want to customize your flow, you can run `git cmf init`,
32+
this command will create a .cmf.yaml file with the default flow.
2433

25-
### Jira
34+
Then you can change the flow as you want.
2635

27-
Running `$ cmf init` and select Jira, you will get the jira flow, this time you will be prompt for:
36+
### Variables
2837

29-
- Jira task ID
30-
- Type of change you made to your code
31-
- Commit message or description of your change
32-
33-
### Custom
34-
35-
Running `$ cmf init`and select custom, you will get the custom flow, this time it will create a `.cmf.yaml`file with default flow but with annotations of how change it.
36-
37-
---
38-
39-
## Variables
40-
41-
CMF have inner variables and you can access it throw templates using `{{}}`:
38+
CMF has inner variables and you can access it throw templates using `{{}}`:
4239

4340
- {{BRANCH_NAME}} it will print the current branch name of your repository
4441

45-
## Configurations
42+
Additionally, you can include external environment variables using the **ENV**
43+
block described on the template.
4644

47-
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`.
45+
### Extending
4846

49-
### TEMPLATE
47+
It is possible to config CMF as you like, you can change
48+
**custom flows, templates, or assign default flows**. You can do this using
49+
a local file on the root of your project or set as global
50+
preferences with a file on your Home directory called `.cmf.yaml`.
5051

51-
Set a template string for commit messages.
52+
### Template Structure
5253

53-
#### Default flow
54+
A `.cmf.yaml` file is composite by 3 main blocks:
55+
- ENV
56+
- PROMPT
57+
- TEMPLATE
5458

55-
Default template `{{CHANGE}}({{MODULE}}): {{MESSAGE}}`. You can use this variables:
59+
#### ENV
5660

57-
- CHANGE _type of change: feature, fix, update_
58-
- MODULE _module affected_
59-
- MESSAGE _commit message_
61+
It is a list of environment variables names, that later are mappings to be
62+
accessible from other blocks.
6063

6164
```
62-
TEMPLATE: "{{CHANGE}}({{MODULE}}): {{MESSAGE}}"
65+
ENV:
66+
- ENVIRONMENT_1
67+
- ENVIRONMENT_2
68+
...
69+
- ENVIRONMENT_10
6370
```
6471

65-
#### Jira flow
66-
67-
Default template `{{JIRA-TASK}} ({{CHANGE}}): {{MESSAGE}}`. You can use this variables:
72+
#### PROMPT
6873

69-
- JIRA*TASK \_jira task id, by default {{BRANCH_NAME}}*
70-
- CHANGE _type of change: feature, fix, update_
71-
- MESSAGE _commit message_
74+
Describe an input flow.
7275

73-
```
74-
TEMPLATE: "{{JIRA-TASK}} ({{CHANGE}}): {{MESSAGE}}"
75-
```
76+
You can create your custom flows using this configuration attribute.`
77+
Every `KEY` attribute is mapping as a variable within the flow.
7678

77-
### PROMPT
78-
79-
You can create your custom flows using this configuration attribute.
80-
81-
Prompt accept two types of prompts:
79+
Prompt accepts two kinds of questions:
8280

8381
- Single question:
8482
- KEY _variable name_
8583
- LABEL _prompt title_
86-
- Select:
84+
85+
- Select question:
8786
- KEY _variable name_
8887
- LABEL _prompt title_
8988
- OPTIONS _list of options_
9089
- VALUE _variable value_
9190
- DESC _variable description_
9291

93-
_default .cmf.yaml sample file_
94-
9592
```
9693
PROMPT:
9794
- KEY: "CHANGE"
@@ -116,13 +113,20 @@ PROMPT:
116113
TEMPLATE: "{{CHANGE}}({{MODULE}}): {{MESSAGE}}"
117114
```
118115

116+
#### TEMPLATE
117+
118+
Defines the way the commit message will be formatted using variables described on .cmf.yaml file.
119+
120+
```
121+
TEMPLATE: "{{CHANGE}}({{MODULE}}): {{MESSAGE}}"
122+
```
119123
---
120124

121125
## Contributions
122126

123127
Use GitHub issues for requests.
124128

125-
I actively welcome pull requests; learn how to contribute.
129+
I actively welcome pull requests; learn how to [contribute](CONTRIBUTING.md).
126130

127131
---
128132

0 commit comments

Comments
 (0)