@@ -9,14 +9,14 @@ import (
9
9
"github.com/conventionalcommit/commitlint/internal"
10
10
)
11
11
12
- // newCmd returns commitlint cli.App
13
- func newCmd () * cli.App {
12
+ // newCliApp returns commitlint cli.App
13
+ func newCliApp () * cli.App {
14
14
cmds := []* cli.Command {
15
- initCmd (),
16
- lintCmd (),
17
- configCmd (),
18
- hookCmd (),
19
- debugCmd (),
15
+ newInitCmd (),
16
+ newLintCmd (),
17
+ newConfigCmd (),
18
+ newHookCmd (),
19
+ newDebugCmd (),
20
20
}
21
21
22
22
app := & cli.App {
@@ -28,14 +28,14 @@ func newCmd() *cli.App {
28
28
return app
29
29
}
30
30
31
- func lintCmd () * cli.Command {
31
+ func newLintCmd () * cli.Command {
32
32
return & cli.Command {
33
33
Name : "lint" ,
34
34
Usage : "Check commit message against lint rules" ,
35
35
Flags : []cli.Flag {
36
36
& cli.StringFlag {
37
37
Name : "config" ,
38
- Aliases : []string {"c" , "conf" },
38
+ Aliases : []string {"c" },
39
39
Value : "" ,
40
40
Usage : "optional config file `conf.yaml`" ,
41
41
},
@@ -54,9 +54,9 @@ func lintCmd() *cli.Command {
54
54
}
55
55
}
56
56
57
- func initCmd () * cli.Command {
58
- confFlag := formConfFlag ()
59
- replaceFlag := formReplaceFlag ()
57
+ func newInitCmd () * cli.Command {
58
+ confFlag := newConfFlag ()
59
+ replaceFlag := newReplaceFlag ()
60
60
61
61
globalFlag := & cli.BoolFlag {
62
62
Name : "global" ,
@@ -89,7 +89,7 @@ func initCmd() *cli.Command {
89
89
}
90
90
}
91
91
92
- func configCmd () * cli.Command {
92
+ func newConfigCmd () * cli.Command {
93
93
createCmd := & cli.Command {
94
94
Name : "create" ,
95
95
Usage : "Creates default config in current directory" ,
@@ -129,7 +129,7 @@ func configCmd() *cli.Command {
129
129
Flags : []cli.Flag {
130
130
& cli.StringFlag {
131
131
Name : "config" ,
132
- Aliases : []string {"c" , "conf" },
132
+ Aliases : []string {"c" },
133
133
Usage : "config file `conf.yaml`" ,
134
134
Required : true ,
135
135
},
@@ -156,8 +156,8 @@ func configCmd() *cli.Command {
156
156
}
157
157
}
158
158
159
- func hookCmd () * cli.Command {
160
- replaceFlag := formReplaceFlag ()
159
+ func newHookCmd () * cli.Command {
160
+ replaceFlag := newReplaceFlag ()
161
161
162
162
createCmd := & cli.Command {
163
163
Name : "create" ,
@@ -186,7 +186,7 @@ func hookCmd() *cli.Command {
186
186
}
187
187
}
188
188
189
- func debugCmd () * cli.Command {
189
+ func newDebugCmd () * cli.Command {
190
190
return & cli.Command {
191
191
Name : "debug" ,
192
192
Usage : "prints usable information for debugging" ,
@@ -196,16 +196,16 @@ func debugCmd() *cli.Command {
196
196
}
197
197
}
198
198
199
- func formConfFlag () * cli.StringFlag {
199
+ func newConfFlag () * cli.StringFlag {
200
200
return & cli.StringFlag {
201
201
Name : "config" ,
202
- Aliases : []string {"c" , "conf" },
202
+ Aliases : []string {"c" },
203
203
Value : "" ,
204
204
Usage : "Optional config file `conf.yaml` which will be passed to 'commitlint lint'. Check config precedence" ,
205
205
}
206
206
}
207
207
208
- func formReplaceFlag () * cli.BoolFlag {
208
+ func newReplaceFlag () * cli.BoolFlag {
209
209
return & cli.BoolFlag {
210
210
Name : "replace" ,
211
211
Usage : "Replace hook files if already exists" ,
0 commit comments