File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ const (
18
18
DefaultFile = "commitlint.yaml"
19
19
)
20
20
21
- // GetConfig returns parses config file, validate it and returns config instance
21
+ // GetConfig gets the config according to precedence
22
+ // if needed parses config file and returns config instance
22
23
func GetConfig (confPath string ) (* lint.Config , error ) {
23
24
confFilePath , useDefault , err := getConfigPath (confPath )
24
25
if err != nil {
@@ -34,9 +35,8 @@ func GetConfig(confPath string) (*lint.Config, error) {
34
35
return nil , err
35
36
}
36
37
37
- err = Validate (conf )
38
- if err != nil {
39
- return nil , fmt .Errorf ("config: %w" , err )
38
+ if conf .Formatter == "" {
39
+ return nil , errors .New ("conf error: formatter is empty" )
40
40
}
41
41
return conf , nil
42
42
}
@@ -82,7 +82,7 @@ func Parse(confPath string) (*lint.Config, error) {
82
82
return conf , nil
83
83
}
84
84
85
- // Validate parses Config from given data
85
+ // Validate validates given config
86
86
func Validate (conf * lint.Config ) error {
87
87
if conf .Formatter == "" {
88
88
return errors .New ("formatter is empty" )
You can’t perform that action at this time.
0 commit comments