File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ const (
18
18
ConfFileName = "commitlint.yaml"
19
19
)
20
20
21
- // GetConfig returns parses config file and returns Config instance
22
- func GetConfig (flagConfPath string ) (* lint.Config , error ) {
23
- confFilePath , useDefault , err := GetConfigPath (flagConfPath )
21
+ // GetConfig returns parses config file, validate it and returns config instance
22
+ func GetConfig (confPath string ) (* lint.Config , error ) {
23
+ confFilePath , useDefault , err := GetConfigPath (confPath )
24
24
if err != nil {
25
25
return nil , err
26
26
}
@@ -33,6 +33,11 @@ func GetConfig(flagConfPath string) (*lint.Config, error) {
33
33
if err != nil {
34
34
return nil , err
35
35
}
36
+
37
+ err = Validate (conf )
38
+ if err != nil {
39
+ return nil , fmt .Errorf ("config: %w" , err )
40
+ }
36
41
return conf , nil
37
42
}
38
43
@@ -74,11 +79,6 @@ func Parse(confPath string) (*lint.Config, error) {
74
79
if err != nil {
75
80
return nil , err
76
81
}
77
-
78
- err = Validate (conf )
79
- if err != nil {
80
- return nil , fmt .Errorf ("config: %w" , err )
81
- }
82
82
return conf , nil
83
83
}
84
84
You can’t perform that action at this time.
0 commit comments