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 (
1818 ConfFileName = "commitlint.yaml"
1919)
2020
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 )
2424 if err != nil {
2525 return nil , err
2626 }
@@ -33,6 +33,11 @@ func GetConfig(flagConfPath string) (*lint.Config, error) {
3333 if err != nil {
3434 return nil , err
3535 }
36+
37+ err = Validate (conf )
38+ if err != nil {
39+ return nil , fmt .Errorf ("config: %w" , err )
40+ }
3641 return conf , nil
3742}
3843
@@ -74,11 +79,6 @@ func Parse(confPath string) (*lint.Config, error) {
7479 if err != nil {
7580 return nil , err
7681 }
77-
78- err = Validate (conf )
79- if err != nil {
80- return nil , fmt .Errorf ("config: %w" , err )
81- }
8282 return conf , nil
8383}
8484
You can’t perform that action at this time.
0 commit comments