MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / LookupAndParse

Function LookupAndParse

config/config.go:145–160  ·  view source on GitHub ↗

LookupAndParse gets the config path according to the precedence if exists, parses the config file and returns config instance

()

Source from the content-addressed store, hash-verified

143// LookupAndParse gets the config path according to the precedence
144// if exists, parses the config file and returns config instance
145func LookupAndParse() (*lint.Config, error) {
146 confFilePath, confType, err := internal.LookupConfigPath()
147 if err != nil {
148 return nil, err
149 }
150
151 if confType == internal.DefaultConfig {
152 return NewDefault(), nil
153 }
154
155 conf, err := Parse(confFilePath)
156 if err != nil {
157 return nil, err
158 }
159 return conf, nil
160}
161
162// WriteTo writes config in yaml format to given io.Writer, including all
163// settings and every field even if empty or zero-valued.

Callers 1

getConfigFunction · 0.92

Calls 3

LookupConfigPathFunction · 0.92
NewDefaultFunction · 0.85
ParseFunction · 0.85

Tested by

no test coverage detected