diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b93f295..9b85071 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -45,7 +45,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: SARIF file path: results.sarif diff --git a/Makefile b/Makefile index 49faa14..fd3076e 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ check_registry: ## Run registry checks .PHONY: gosec_install gosec_install: ## Install gosec utility - go install github.com/securego/gosec/v2/cmd/gosec@v2.14.0 + go install github.com/securego/gosec/v2/cmd/gosec@v2.22.0 .PHONY: gosec gosec: ## Run go security checks @@ -40,5 +40,4 @@ lint: ## Run golangci-lint linter tool .PHONY: lint_install lint_install: ## Install golangci-lint linter tool - @# TODO(rm3l): recent versions of golangci-lint require Go >= 1.20. Update when we start using Go 1.20+ - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 diff --git a/go.mod b/go.mod index 87395d0..78a5f65 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/devfile/alizer -go 1.21 +go 1.23 require ( github.com/go-git/go-git/v5 v5.13.1 diff --git a/test/apis/component_recognizer_test.go b/test/apis/component_recognizer_test.go index f3d23ec..bee75fc 100644 --- a/test/apis/component_recognizer_test.go +++ b/test/apis/component_recognizer_test.go @@ -361,7 +361,7 @@ func TestPortDetectionFlaskStringValue(t *testing.T) { func TestComponentDetectionNoResult(t *testing.T) { components := getComponentsFromTestProject(t, "simple") if len(components) > 0 { - t.Errorf("Expected 0 components but found " + strconv.Itoa(len(components))) + t.Errorf("Expected 0 components but found %v", strconv.Itoa(len(components))) } } @@ -395,7 +395,7 @@ func TestComponentDetectionWithGitIgnoreRule(t *testing.T) { components := getComponentsFromFiles(t, files, settings) if len(components) != 1 { - t.Errorf("Expected 1 components but found " + strconv.Itoa(len(components))) + t.Errorf("Expected 1 components but found %v", strconv.Itoa(len(components))) } //now add a gitIgnore with a rule to exclude the only component found @@ -413,7 +413,7 @@ func TestComponentDetectionWithGitIgnoreRule(t *testing.T) { os.Remove(gitIgnorePath) if len(componentsWithUpdatedGitIgnore) != 0 { - t.Errorf("Expected 0 components but found " + strconv.Itoa(len(componentsWithUpdatedGitIgnore))) + t.Errorf("Expected 0 components but found %v", strconv.Itoa(len(componentsWithUpdatedGitIgnore))) } } @@ -421,7 +421,7 @@ func TestComponentDetectionMultiProjects(t *testing.T) { components := getComponentsFromTestProject(t, "") nComps := 70 if len(components) != nComps { - t.Errorf("Expected " + strconv.Itoa(nComps) + " components but found " + strconv.Itoa(len(components))) + t.Errorf("Expected %v components but found %v", strconv.Itoa(nComps), strconv.Itoa(len(components))) } } diff --git a/test/apis/language_recognizer_test.go b/test/apis/language_recognizer_test.go index ff33518..ed8b192 100644 --- a/test/apis/language_recognizer_test.go +++ b/test/apis/language_recognizer_test.go @@ -63,7 +63,7 @@ func isLanguageInProject(t *testing.T, project string, wantedLanguage string, wa } if !hasWantedLanguage(languages, wantedLanguage, wantedTools, wantedFrameworks) { - t.Errorf("Project does not use " + wantedLanguage + " language") + t.Errorf("Project does not use %v language", wantedLanguage) } } diff --git a/test/apis/utils.go b/test/apis/utils.go index 927633c..120f4d0 100644 --- a/test/apis/utils.go +++ b/test/apis/utils.go @@ -61,16 +61,16 @@ func verifyComponents(t *testing.T, components []model.Component, expectedNumber if hasComponents { isExpectedComponent := strings.EqualFold(expectedLanguage, components[0].Languages[0].Name) if !isExpectedComponent { - t.Errorf("Project does not use " + expectedLanguage + " language") + t.Errorf("Project does not use %v language ", expectedLanguage) } if expectedProjectName != "" { isExpectedProjectName := strings.EqualFold(expectedProjectName, components[0].Name) if !isExpectedProjectName { - t.Errorf("Main component has a different project name. Expected " + expectedProjectName + " but it was " + components[0].Name) + t.Errorf("Main component has a different project name. Expected %v but it was %v", expectedProjectName, components[0].Name) } } } else { - t.Errorf("Expected " + strconv.Itoa(expectedNumber) + " of components but it was " + strconv.Itoa(len(components))) + t.Errorf("Expected %v of components but it was %v", strconv.Itoa(expectedNumber), strconv.Itoa(len(components))) } } @@ -94,7 +94,7 @@ func testPortDetectionInProject(t *testing.T, project string, ports []int) { } } if !found { - t.Errorf("Port " + strconv.Itoa(port) + " have not been detected") + t.Errorf("Port %v have not been detected", strconv.Itoa(port)) } found = false }