diff --git a/internal/makefile/funcs.go b/internal/makefile/funcs.go index 1608728..701c64a 100644 --- a/internal/makefile/funcs.go +++ b/internal/makefile/funcs.go @@ -35,14 +35,14 @@ func FixRuleIndentation(in string) string { var currentRecipeLines []string for _, line := range strings.SplitAfter(in, "\n") { - //when inside a recipe, collect all lines belonging to it first + // when inside a recipe, collect all lines belonging to it first if isRecipeRx.MatchString(line) { currentRecipeLines = append(currentRecipeLines, line) continue } - //when not inside a recipe, return this line unchanged, but first transform - //the collected recipe (if any) + // when not inside a recipe, return this line unchanged, but first transform + // the collected recipe (if any) if len(currentRecipeLines) > 0 { for _, line := range fixRecipeIndentation(currentRecipeLines) { out.WriteString(line) diff --git a/internal/makefile/makefile.go b/internal/makefile/makefile.go index 470c955..dee3651 100644 --- a/internal/makefile/makefile.go +++ b/internal/makefile/makefile.go @@ -77,7 +77,7 @@ endif // Prepare prepare := category{name: "prepare"} - //add target for installing dependencies for `make static-check` + // add target for installing dependencies for `make static-check` prepareStaticRecipe := []string{ `@if ! hash golangci-lint 2>/dev/null; then` + ` printf "\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n";` + @@ -217,7 +217,7 @@ endif test.addDefinition(`space := $(null) $(null)`) test.addDefinition(`comma := ,`) - //add main testing target + // add main testing target checkPrerequisites := []string{"static-check", "build/cover.html"} if hasBinaries { checkPrerequisites = append(checkPrerequisites, "build-all") @@ -257,7 +257,7 @@ endif }, }) - //add targets for test runner incl. coverage report + // add targets for test runner incl. coverage report testRule := rule{ description: "Run tests and generate coverage report.", phony: true, @@ -302,13 +302,13 @@ endif // Development dev := category{name: "development"} - //ensure that build directory exists + // ensure that build directory exists dev.addRule(rule{ target: "build", recipe: []string{`@mkdir $@`}, }) - //add tidy-deps or vendor target + // add tidy-deps or vendor target if cfg.Golang.EnableVendoring { dev.addRule(rule{ description: "Run go mod tidy, go mod verify, and go mod vendor.", @@ -350,7 +350,7 @@ endif ignoreOptions := []string{} if cfg.GitHubWorkflow != nil { for _, pattern := range cfg.GitHubWorkflow.License.IgnorePatterns { - //quoting avoids glob expansion + // quoting avoids glob expansion ignoreOptions = append(ignoreOptions, fmt.Sprintf("-ignore %q", pattern)) } } @@ -401,7 +401,7 @@ endif }) } - //add target for static code checks + // add target for static code checks staticCheckPrerequisites := []string{"run-golangci-lint"} if isSAPCC { staticCheckPrerequisites = append(staticCheckPrerequisites, "check-dependency-licenses", "check-license-headers") @@ -413,7 +413,7 @@ endif prerequisites: staticCheckPrerequisites, }) - //add cleaning target + // add cleaning target dev.addRule(rule{ description: "Run git clean.", target: "clean", diff --git a/internal/makefile/render.go b/internal/makefile/render.go index b13689a..32bdf68 100644 --- a/internal/makefile/render.go +++ b/internal/makefile/render.go @@ -82,7 +82,7 @@ type makefile struct { } func (m *makefile) vars() *rule { - //collect all variable refs that look like $(THIS) or $(LIKE_THAT) from definitions and recipes + // collect all variable refs that look like $(THIS) or $(LIKE_THAT) from definitions and recipes varRefRx := regexp.MustCompile(`\$\([A-Za-z_][A-Za-z0-9_]*\)`) isVarRef := make(map[string]bool) searchIn := func(inputs []string) { @@ -100,12 +100,12 @@ func (m *makefile) vars() *rule { } } - //skip some variables that we only use internally to circumvent Makefile syntax limitations + // skip some variables that we only use internally to circumvent Makefile syntax limitations delete(isVarRef, "$(comma)") delete(isVarRef, "$(null)") delete(isVarRef, "$(space)") - //compile a sorted list of variable names + // compile a sorted list of variable names var varNames []string for varRef := range isVarRef { str := strings.TrimPrefix(varRef, "$(") @@ -114,7 +114,7 @@ func (m *makefile) vars() *rule { } sort.Strings(varNames) - //generate a target printing their values (the output is not colorized to allow usage like `eval "$(make vars)"`) + // generate a target printing their values (the output is not colorized to allow usage like `eval "$(make vars)"`) result := rule{ phony: true, target: "vars", diff --git a/internal/renovate/renovate.go b/internal/renovate/renovate.go index 16a117c..724e41c 100644 --- a/internal/renovate/renovate.go +++ b/internal/renovate/renovate.go @@ -127,8 +127,7 @@ func RenderConfig(cfgRenovate core.RenovateConfig, scanResult core.ScanResult, u } hasK8sIOPkgs := false for _, v := range scanResult.GoDirectDependencies { - switch dep := v.Path; { - case strings.HasPrefix(dep, "k8s.io/"): + if strings.HasPrefix(v.Path, "k8s.io/") { hasK8sIOPkgs = true } }