Skip to content
GitHub Actions / golangci failed Feb 22, 2025 in 0s

reviewdog [golangci] report

reported by reviewdog 🐶

Findings (26)

pkg/config/utils.go|800| file-length-limit: file length is 667 lines, which exceeds the limit of 500 (revive)
pkg/config/imports.go|157 col 50| add-constant: string literal "import" appears, at least, 4 times, create a named constant for it (revive)
pkg/config/imports.go|45 col 10| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("source and destination cannot be nil")" (err113)
pkg/config/imports.go|83 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("maximum import depth of %d exceeded", maxDepth)" (err113)
pkg/config/imports.go|87 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("failed to resolve base path: %v", err)" (err113)
pkg/config/imports.go|126 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("unsupported URL '%s': %v", importPath, err)" (err113)
pkg/config/imports.go|138 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("failed to read remote config")" (err113)
pkg/config/imports.go|158 col 16| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("failed to process nested imports")" (err113)
pkg/config/imports.go|169 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("import_path required to process imports")" (err113)
pkg/config/imports.go|292 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("no valid absolute paths found")" (err113)
pkg/config/imports.go|382 col 15| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("no files matching patterns found")" (err113)
pkg/config/load.go|223 col 10| do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("atmos config directory not found path %s", dirPath)" (err113)
pkg/config/import_test.go|115 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
pkg/config/imports.go|34 col 1| Comment should end in a period (godot)
pkg/config/imports.go|117 col 1| Comment should end in a period (godot)
pkg/config/imports.go|122 col 1| Comment should end in a period (godot)
pkg/config/imports.go|166 col 1| Comment should end in a period (godot)
pkg/config/imports.go|250 col 1| Comment should end in a period (godot)
pkg/config/imports.go|279 col 1| Comment should end in a period (godot)
pkg/config/imports.go|369 col 1| Comment should end in a period (godot)
pkg/config/import_test.go|20 col 1| Comment should end in a period (godot)
pkg/config/imports.go|154 col 5| S1009: should omit nil check; len() for nil slices is defined as zero (gosimple)
pkg/config/imports.go|13 col 2| import "github.com/charmbracelet/log" imported without alias but must be with alias "log" according to config (importas)
pkg/config/imports.go|47 col 1| if len(source.Import) > 0 has complex nested blocks (complexity: 4) (nestif)
pkg/config/imports.go|251 col 47| generatePatterns - result 1 (error) is always nil (unparam)
pkg/config/load.go|196 col 47| mergeConfig - fileName always receives CliConfigFileName ("atmos") (unparam)

Filtered Findings (0)

Annotations

Check failure on line 800 in pkg/config/utils.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/config/utils.go#L800

file-length-limit: file length is 667 lines, which exceeds the limit of 500 (revive)
Raw output
pkg/config/utils.go:800: file-length-limit: file length is 667 lines, which exceeds the limit of 500 (revive)

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

add-constant: string literal "import" appears, at least, 4 times, create a named constant for it (revive)
Raw output
pkg/config/imports.go:157:50: add-constant: string literal "import" appears, at least, 4 times, create a named constant for it (revive)
			log.Debug("failed to process nested imports", "import", importPath, "err", err)
			                                              ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"source and destination cannot be nil\")" (err113)
Raw output
pkg/config/imports.go:45:10: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"source and destination cannot be nil\")" (err113)
		return fmt.Errorf("source and destination cannot be nil")
		       ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"maximum import depth of %d exceeded\", maxDepth)" (err113)
Raw output
pkg/config/imports.go:83:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"maximum import depth of %d exceeded\", maxDepth)" (err113)
		return nil, fmt.Errorf("maximum import depth of %d exceeded", maxDepth)
		            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to resolve base path: %v\", err)" (err113)
Raw output
pkg/config/imports.go:87:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to resolve base path: %v\", err)" (err113)
		return nil, fmt.Errorf("failed to resolve base path: %v", err)
		            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"unsupported URL '%s': %v\", importPath, err)" (err113)
Raw output
pkg/config/imports.go:126:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"unsupported URL '%s': %v\", importPath, err)" (err113)
		return nil, fmt.Errorf("unsupported URL '%s': %v", importPath, err)
		            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to read remote config\")" (err113)
Raw output
pkg/config/imports.go:138:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to read remote config\")" (err113)
		return nil, fmt.Errorf("failed to read remote config")
		            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to process nested imports\")" (err113)
Raw output
pkg/config/imports.go:158:16: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to process nested imports\")" (err113)
			return nil, fmt.Errorf("failed to process nested imports")
			            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"import_path required to process imports\")" (err113)
Raw output
pkg/config/imports.go:169:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"import_path required to process imports\")" (err113)
		return nil, fmt.Errorf("import_path required to process imports")
		            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"no valid absolute paths found\")" (err113)
Raw output
pkg/config/imports.go:292:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"no valid absolute paths found\")" (err113)
		return nil, fmt.Errorf("no valid absolute paths found")
		            ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"no files matching patterns found\")" (err113)
Raw output
pkg/config/imports.go:382:15: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"no files matching patterns found\")" (err113)
		return nil, fmt.Errorf("no files matching patterns found")
		            ^

Check failure on line 223 in pkg/config/load.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/config/load.go#L223

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"atmos config directory not found path %s\", dirPath)" (err113)
Raw output
pkg/config/load.go:223:10: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"atmos config directory not found path %s\", dirPath)" (err113)
		return fmt.Errorf("atmos config directory not found path %s", dirPath)
		       ^

Check failure on line 115 in pkg/config/import_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/config/import_test.go#L115

ifElseChain: rewrite if-else to switch statement (gocritic)
Raw output
pkg/config/import_test.go:115:3: ifElseChain: rewrite if-else to switch statement (gocritic)
		if r.URL.Path == "/config.yaml" {
		^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:34:1: Comment should end in a period (godot)
// import Resolved Paths
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:117:1: Comment should end in a period (godot)
// Helper to determine if the import is a supported remote source
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:122:1: Comment should end in a period (godot)
// Process remote imports
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:166:1: Comment should end in a period (godot)
// Process local imports
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:250:1: Comment should end in a period (godot)
// Helper function to generate search patterns for extension yaml,yml
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:279:1: Comment should end in a period (godot)
// Helper function to convert paths to absolute paths
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

Comment should end in a period (godot)
Raw output
pkg/config/imports.go:369:1: Comment should end in a period (godot)
// Helper function to find files matching the patterns
^

Check failure on line 20 in pkg/config/import_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/config/import_test.go#L20

Comment should end in a period (godot)
Raw output
pkg/config/import_test.go:20:1: Comment should end in a period (godot)
// Test for processImports
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

S1009: should omit nil check; len() for nil slices is defined as zero (gosimple)
Raw output
pkg/config/imports.go:154:5: S1009: should omit nil check; len() for nil slices is defined as zero (gosimple)
	if Imports != nil && len(Imports) > 0 {
	   ^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

import "github.com/charmbracelet/log" imported without alias but must be with alias "log" according to config (importas)
Raw output
pkg/config/imports.go:13:2: import "github.com/charmbracelet/log" imported without alias but must be with alias "log" according to config (importas)
	"github.com/charmbracelet/log"
	^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

`if len(source.Import) > 0` has complex nested blocks (complexity: 4) (nestif)
Raw output
pkg/config/imports.go:47:1: `if len(source.Import) > 0` has complex nested blocks (complexity: 4) (nestif)
	if len(source.Import) > 0 {
^

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

See this annotation in the file changed.

@github-actions github-actions / golangci

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

generatePatterns - result 1 (error) is always nil (unparam)
Raw output
pkg/config/imports.go:251:47: generatePatterns - result 1 (error) is always nil (unparam)
func generatePatterns(path string) ([]string, error) {
                                              ^