Skip to content

Commit

Permalink
[all] Enable govulncheck linter for the whole repo (open-telemetry#19400
Browse files Browse the repository at this point in the history
)

Enable govulncheck linter

Link to tracking Issue: open-telemetry#19154

---------

Co-authored-by: Alex Boten <alex@boten.ca>
  • Loading branch information
lootek and codeboten authored Mar 22, 2023
1 parent 40905a4 commit 4524ffc
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ~1.19.6
go-version: ~1.19.7
- name: Cache Go
id: go-mod-cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ~1.19.6
go-version: ~1.19.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ~1.19.6
go-version: ~1.19.7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-dependabot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ~1.19.6
go-version: ~1.19.7
- name: Run dependabot-pr.sh
run: ./.github/workflows/scripts/dependabot-pr.sh
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ~1.19.6
go-version: ~1.19.7
- name: Prepare release for contrib
working-directory: opentelemetry-collector-contrib
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prometheus-compliance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ~1.19.6
go-version: ~1.19.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down
11 changes: 8 additions & 3 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ GOIMPORTS := $(TOOLS_BIN_DIR)/goimports
PORTO := $(TOOLS_BIN_DIR)/porto
CHECKDOC := $(TOOLS_BIN_DIR)/checkdoc
CROSSLINK := $(TOOLS_BIN_DIR)/crosslink
GOJUNIT := $(TOOLS_BIN_DIR)/go-junit-report
GOJUNIT := $(TOOLS_BIN_DIR)/go-junit-report
BUILDER := $(TOOLS_BIN_DIR)/builder
GOVULNCHECK := $(TOOLS_BIN_DIR)/govulncheck

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down Expand Up @@ -91,7 +92,7 @@ all-pkg-dirs:
.DEFAULT_GOAL := common

.PHONY: common
common: checklicense lint misspell
common: lint

.PHONY: test
test:
Expand Down Expand Up @@ -162,9 +163,13 @@ fmt: $(GOIMPORTS)
$(GOIMPORTS) -w -local github.com/open-telemetry/opentelemetry-collector-contrib ./

.PHONY: lint
lint: $(LINT) checklicense misspell
lint: $(LINT) checklicense misspell govulncheck
$(LINT) run --allow-parallel-runners --build-tags integration

.PHONY: govulncheck
govulncheck: $(GOVULNCHECK)
$(GOVULNCHECK) ./...

.PHONY: tidy
tidy:
rm -fr go.sum
Expand Down
1 change: 1 addition & 0 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
go.opentelemetry.io/build-tools/multimod v0.6.0
go.opentelemetry.io/collector/cmd/builder v0.71.1-0.20230208170110-ead716ac04aa
golang.org/x/tools v0.7.0
golang.org/x/vuln v0.0.0-20230313161840-8a73a7e4f203
)

require (
Expand Down
4 changes: 4 additions & 0 deletions internal/tools/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ import (
_ "go.opentelemetry.io/build-tools/multimod"
_ "go.opentelemetry.io/collector/cmd/builder"
_ "golang.org/x/tools/cmd/goimports"
_ "golang.org/x/vuln/cmd/govulncheck"
)

0 comments on commit 4524ffc

Please sign in to comment.