You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+60-56Lines changed: 60 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -1,97 +1,94 @@
1
-
# CMF Commit Message Formatter - V2
1
+
# CMF Commit Message Formatter - V3
2
2
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.
4
4
5
-
## Getting started
5
+
## Migrating from V2
6
6
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.
8
9
9
-
Or from Go `go install github.com/walmartdigital/commit-message-formatter`
10
+
## Major changes
10
11
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.
12
18
13
-
## Flows
19
+
## Getting Started
14
20
15
-
CMF have three flows (for now) default, Jira and custom
21
+
### Install CMF
16
22
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
18
28
19
-
Running `$ cmf init` and select default, you will get the default flow and prompted for:
29
+
### Initialize project (optional)
20
30
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.
24
33
25
-
### Jira
34
+
Then you can change the flow as you want.
26
35
27
-
Running `$ cmf init` and select Jira, you will get the jira flow, this time you will be prompt for:
36
+
### Variables
28
37
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 `{{}}`:
42
39
43
40
- {{BRANCH_NAME}} it will print the current branch name of your repository
44
41
45
-
## Configurations
42
+
Additionally, you can include external environment variables using the **ENV**
43
+
block described on the template.
46
44
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
48
46
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`.
50
51
51
-
Set a template string for commit messages.
52
+
### Template Structure
52
53
53
-
#### Default flow
54
+
A `.cmf.yaml` file is composite by 3 main blocks:
55
+
- ENV
56
+
- PROMPT
57
+
- TEMPLATE
54
58
55
-
Default template `{{CHANGE}}({{MODULE}}): {{MESSAGE}}`. You can use this variables:
59
+
#### ENV
56
60
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.
60
63
61
64
```
62
-
TEMPLATE: "{{CHANGE}}({{MODULE}}): {{MESSAGE}}"
65
+
ENV:
66
+
- ENVIRONMENT_1
67
+
- ENVIRONMENT_2
68
+
...
69
+
- ENVIRONMENT_10
63
70
```
64
71
65
-
#### Jira flow
66
-
67
-
Default template `{{JIRA-TASK}} ({{CHANGE}}): {{MESSAGE}}`. You can use this variables:
72
+
#### PROMPT
68
73
69
-
- JIRA*TASK \_jira task id, by default {{BRANCH_NAME}}*
0 commit comments