Skip to content

Commit 6d16316

Browse files
docs(config): update function comments
1 parent 88b2569 commit 6d16316

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

config/config.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const (
1919
ConfigFile = "commitlint.yaml"
2020
)
2121

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
2424
func GetConfig(confPath string) (*lint.Config, error) {
2525
confFilePath, useDefault, err := getConfigPath(confPath)
2626
if err != nil {
@@ -73,7 +73,7 @@ func getConfigPath(confFilePath string) (confPath string, isDefault bool, retErr
7373
return filepath.Clean(confFilePath), false, nil
7474
}
7575

76-
// Parse parse Config from given file
76+
// Parse parse given file in confPath, and return Config instance, error if any
7777
func Parse(confPath string) (*lint.Config, error) {
7878
confBytes, err := os.ReadFile(confPath)
7979
if err != nil {
@@ -88,7 +88,10 @@ func Parse(confPath string) (*lint.Config, error) {
8888
return conf, nil
8989
}
9090

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
9295
func Validate(conf *lint.Config) []error {
9396
var errs []error
9497

0 commit comments

Comments
 (0)