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 (
1818 DefaultFile = "commitlint.yaml"
1919)
2020
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
2223func GetConfig (confPath string ) (* lint.Config , error ) {
2324 confFilePath , useDefault , err := getConfigPath (confPath )
2425 if err != nil {
@@ -34,9 +35,8 @@ func GetConfig(confPath string) (*lint.Config, error) {
3435 return nil , err
3536 }
3637
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" )
4040 }
4141 return conf , nil
4242}
@@ -82,7 +82,7 @@ func Parse(confPath string) (*lint.Config, error) {
8282 return conf , nil
8383}
8484
85- // Validate parses Config from given data
85+ // Validate validates given config
8686func Validate (conf * lint.Config ) error {
8787 if conf .Formatter == "" {
8888 return errors .New ("formatter is empty" )
You can’t perform that action at this time.
0 commit comments