From 608e840fe2f07e5b230e5483328fecfceb424584 Mon Sep 17 00:00:00 2001 From: Andrey Markelov Date: Thu, 2 Jul 2026 00:39:22 -0700 Subject: [PATCH] ci: add staticcheck to CI and release workflows Adds staticcheck v0.7.0 as a separate lint job in CI and as a step in the release workflow. Fixes the one finding: trailing period in an error string in cmd/logout.go. --- .github/workflows/ci.yml | 11 +++++++++++ .github/workflows/release.yml | 2 ++ cmd/logout.go | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce2f9a4a..1dc30d79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,17 @@ jobs: - run: go test ./... - run: go build ./... + lint: + name: Staticcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-go@v6 + with: + go-version: "1.25" + - run: go install honnef.co/go/tools/cmd/staticcheck@v0.7.0 + - run: staticcheck ./... + release-build: name: Release binary build runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b0fa00c..af0f8d0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,8 @@ jobs: go-version: "1.25" - run: go install golang.org/x/vuln/cmd/govulncheck@latest - run: govulncheck ./... + - run: go install honnef.co/go/tools/cmd/staticcheck@v0.7.0 + - run: staticcheck ./... - run: go vet ./... - run: go test ./... - run: go build ./... diff --git a/cmd/logout.go b/cmd/logout.go index ef2ff0ef..3ae145cf 100644 --- a/cmd/logout.go +++ b/cmd/logout.go @@ -54,7 +54,7 @@ var revokeAccessToken = func(domain string, token string) error { // Command logout revokes all saved API tokens and deletes auth.json. func logout(cmd *cobra.Command, args []string) error { if os.Getenv(envAccessToken) != "" { - return newCodedError(jsonErrorCodeEnvTokenStillActive, errors.New("DBXCLI_ACCESS_TOKEN is set; unset it before running logout.")) + return newCodedError(jsonErrorCodeEnvTokenStillActive, errors.New("DBXCLI_ACCESS_TOKEN is set; unset it before running logout")) } filePath, err := authFilePath()