From 82b4cfdedc08109e5448fd39142588ba3eb562f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Felipe=20=C3=81lvarez?= Date: Thu, 28 Jul 2022 15:49:05 +0200 Subject: [PATCH] chore: use infra-checkers static analysis settings --- .github/workflows/push_pr.yml | 7 ++- .golangci.yml | 102 ---------------------------------- 2 files changed, 6 insertions(+), 103 deletions(-) delete mode 100644 .golangci.yml diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 28227d8..eb88372 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -20,13 +20,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 9d23c41..0000000 --- a/.golangci.yml +++ /dev/null @@ -1,102 +0,0 @@ -run: - timeout: 5m - -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: 10 - 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 - - 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 - # - goerr113 #Errors are not defined in the integration. - # - nakedret - # - nolintlint - # - testpackage - # - revive - # - wsl