LookupAndParse gets the config path according to the precedence if exists, parses the config file and returns config instance
()
| 143 | // LookupAndParse gets the config path according to the precedence |
| 144 | // if exists, parses the config file and returns config instance |
| 145 | func 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. |
no test coverage detected