@@ -19,8 +19,8 @@ const (
19
19
ConfigFile = "commitlint.yaml"
20
20
)
21
21
22
- // GetConfig gets the config according to precedence
23
- // if needed parses config file and returns config instance
22
+ // GetConfig gets the config path according to the precedence
23
+ // if needed parses given config file and returns config instance
24
24
func GetConfig (confPath string ) (* lint.Config , error ) {
25
25
confFilePath , useDefault , err := getConfigPath (confPath )
26
26
if err != nil {
@@ -73,7 +73,7 @@ func getConfigPath(confFilePath string) (confPath string, isDefault bool, retErr
73
73
return filepath .Clean (confFilePath ), false , nil
74
74
}
75
75
76
- // Parse parse Config from given file
76
+ // Parse parse given file in confPath, and return Config instance, error if any
77
77
func Parse (confPath string ) (* lint.Config , error ) {
78
78
confBytes , err := os .ReadFile (confPath )
79
79
if err != nil {
@@ -88,7 +88,10 @@ func Parse(confPath string) (*lint.Config, error) {
88
88
return conf , nil
89
89
}
90
90
91
- // Validate validates given config
91
+ // Validate validates given config instance, it checks the following
92
+ // If formatters, rules are registered/known
93
+ // If arguments to rules are valid
94
+ // If version is valid and atleast minimum than commitlint version used
92
95
func Validate (conf * lint.Config ) []error {
93
96
var errs []error
94
97
0 commit comments