Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Feb 21, 2025
1 parent 413f955 commit eae3f97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/config/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func TestProcessImports(t *testing.T) {
assert.NotContains(t, resolvedPaths, "http://invalid-url.com", "Invalid URL should not be resolved")
assert.NotContains(t, resolvedPaths, "", "Empty import path should not be resolved")
}

func TestProcessImportNested(t *testing.T) {
baseDir, err := os.MkdirTemp("", "config-test")
assert.NoError(t, err)
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func processConfigImports(source schema.AtmosConfiguration, dst *viper.Viper) er
}
return nil
}

func processImports(basePath string, importPaths []string, tempDir string, currentDepth, maxDepth int) (resolvedPaths []ResolvedPaths, err error) {
if basePath == "" {
return nil, fmt.Errorf("base_Path required to process imports")

Check failure on line 68 in pkg/config/imports.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] pkg/config/imports.go#L68

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"base_Path required to process imports\")" (err113)
Raw output
pkg/config/imports.go:68:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"base_Path required to process imports\")" (err113)
		return nil, fmt.Errorf("base_Path required to process imports")
		            ^
Expand Down Expand Up @@ -374,6 +375,7 @@ func findMatchingFiles(patterns []string) ([]string, error) {

return filePaths, nil
}

func downloadRemoteConfig(url string, tempDir string) (string, error) {
// uniq name for the temp file
fileName := fmt.Sprintf("atmos-import-%d.yaml", time.Now().UnixNano())
Expand Down
1 change: 1 addition & 0 deletions pkg/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func readEnvAmosConfigPath(v *viper.Viper) error {

return nil
}

func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
if len(atmosCliConfigPath) == 0 {
return nil
Expand Down

0 comments on commit eae3f97

Please sign in to comment.