From a5ab06080c4da1ec439be1ba23c3f33c5ea975d2 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 11:18:48 +0200 Subject: [PATCH] chore: use infra-checkers static analysis settings (#187) --- .github/workflows/push_pr.yml | 7 ++- .golangci.yml | 99 ----------------------------------- 2 files changed, 6 insertions(+), 100 deletions(-) delete mode 100644 .golangci.yml diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 3c6b6dc6..d89b40d0 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -21,13 +21,18 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} - uses: newrelic/newrelic-infra-checkers@v1 + with: + golangci-lint-config: golangci-lint-limited - name: Semgrep uses: returntocorp/semgrep-action@v1 with: auditOn: push - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 continue-on-error: ${{ github.event_name != 'pull_request' }} with: only-new-issues: true diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index 2ad20765..00000000 --- a/.golangci.yml +++ /dev/null @@ -1,99 +0,0 @@ -linters-settings: - dupl: - threshold: 100 - funlen: - lines: 100 - statements: 50 - gci: - local-prefixes: github.com/golangci/golangci-lint - # goconst: - # min-len: 2 - # min-occurrences: 2 - gocyclo: - min-complexity: 12 - golint: - min-confidence: 0.8 - gomnd: - settings: - mnd: - # don't include the "operation" and "assign" - checks: argument,case,condition,return - govet: - check-shadowing: true - settings: - printf: - funcs: - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - maligned: - suggest-new: true - misspell: - locale: US - nolintlint: - allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) - allow-unused: false # report any unused nolint directives - require-explanation: false # don't require an explanation for nolint directives - require-specific: false # don't require nolint directives to be specific about which linter is being skipped - -linters: - # please, do not use `enable-all`: it's deprecated and will be removed soon. - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint - disable-all: true - enable: - - bodyclose - - deadcode - - depguard - - dogsled - - dupl - - errcheck - - exportloopref - - exhaustive - - funlen - - gochecknoinits - - gocritic - - gocyclo - - gocognit - - goerr113 #only add if go > 1.13 - - errorlint #only add if go > 1.13 - - gofmt - - goimports - - golint - - gomnd - - goprintffuncname - - gosec - - gosimple - - govet - - ineffassign - - maligned - - misspell - - nestif - - nilerr - - noctx - - prealloc - - rowserrcheck - - staticcheck - - structcheck - - stylecheck - - typecheck - - unconvert - - unparam - - unused - - varcheck - - whitespace - - # don't enable: - # - asciicheck - # - scopelint - # - gochecknoglobals - # - goconst #looks for repetitions of variables that should go on constant - # - godot - # - godox - # - interfacer - # - lll - # - nakedret - # - nolintlint - # - testpackage - # - revive - # - wsl