diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a867e784b..76a5edce2b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,15 +45,13 @@ jobs: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - # TODO fix this step (cant find the path to golangci.yml) - name: golangci-lint uses: golangci/golangci-lint-action@v6 - continue-on-error: true # we dont want to enforce just yet with: - version: v1.52.2 + version: latest args: --timeout=15m --config=.golangci.yml - skip-pkg-cache: true - skip-build-cache: true + working-directory: steampipe + skip-cache: true - name: Run CLI Unit Tests run: | diff --git a/.golangci.yml b/.golangci.yml index 5c9b05b15d..eaa5b4e937 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,10 +11,10 @@ linters: - unused # other rules - asasalint + - depguard - asciicheck - bidichk - durationcheck - - exportloopref - forbidigo - gocritic - gocheckcompilerdirectives @@ -31,6 +31,13 @@ linters-settings: require-explanation: true require-specific: true + forbidigo: + forbid: + - "^(fmt\\.Print(|f|ln)|print|println)$" + - "^(fmt\\.Fprint(|f|ln)|print|println)$" + - '^zap\.Error$' + - '^grpc\.(Header|Trailer)$' # easy to misuse and create a data race + gocritic: disabled-checks: - ifElseChain # style @@ -38,7 +45,28 @@ linters-settings: - assignOp # style - commentFormatting # style + depguard: + rules: + # Name of a rule. + main: + # List of file globs that will match this list of settings to compare against. + # Default: $all + # files: + # - "!**/*_a _file.go" + # List of allowed packages. + # allow: + # - $gostd + # - github.com/OpenPeeDeeP + # Packages that are not allowed where the value is a suggestion. + deny: + - pkg: "go.uber.org/zap" + desc: do not use Uber zap directly, use the fplog package instead + - pkg: "github.com/pkg/errors" + desc: Should be replaced by standard lib errors package + run: timeout: 5m - skip-dirs: + +issues: + exclude-dirs: - "tests/acceptance"