Skip to content

Commit

Permalink
chore: move comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kiliantyler committed Feb 29, 2024
1 parent 74a8ce8 commit 091e0f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/yamlfmt/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ func getConfigPath() (string, error) {
}

func getConfigPathFromFlag() (string, error) {
// If there is a path specified in the conf flag, that takes precedence
// First check if the global configuration was explicitly requested as that takes precedence.
if *flagGlobalConf {
logger.Debug(logger.DebugCodeConfig, "Using -global_conf flag")
return getConfigPathFromXdgConfigHome()
}

// If the global config wasn't explicitly requested, check if there was a specific configuration path supplied.
configPath := *flagConf
if configPath != "" {
logger.Debug(logger.DebugCodeConfig, "Using config path %s from -conf flag", configPath)
return configPath, validatePath(configPath)
}
// Then we check if we want the global config

logger.Debug(logger.DebugCodeConfig, "No config path specified in -conf")
return configPath, errNoConfFlag
}
Expand Down

0 comments on commit 091e0f7

Please sign in to comment.