We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21ca532 commit da6a3e2Copy full SHA for da6a3e2
cmd/yamlfmt/config.go
@@ -154,13 +154,17 @@ func getConfigPathFromDirTree() (string, error) {
154
return "", err
155
}
156
dir := absPath
157
- for dir != filepath.Dir(dir) {
+ for true {
158
configPath, err := getConfigPathFromDir(dir)
159
if err == nil {
160
logger.Debug(logger.DebugCodeConfig, "Found config at %s", configPath)
161
return configPath, nil
162
163
+ previousDir := dir
164
dir = filepath.Dir(dir)
165
+ if dir == previousDir {
166
+ break
167
+ }
168
169
return "", errConfPathNotExist
170
0 commit comments