From 379ca4b4e609798e62d2865b53736816c7faf75e Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Wed, 25 Sep 2024 21:45:02 +0300 Subject: [PATCH] linter: use org-wide version of linter Close #3591, Close #3417. Signed-off-by: Ekaterina Pavlova --- .github/workflows/tests.yml | 14 +------ .gitignore | 3 ++ .golangci.yml | 74 ------------------------------------- Makefile | 5 ++- 4 files changed, 8 insertions(+), 88 deletions(-) delete mode 100644 .golangci.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4cf7bb0aa..743a08453 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,19 +15,7 @@ on: jobs: lint: name: Lint - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - - name: golangci-lint - uses: golangci/golangci-lint-action@v4 - with: - version: latest - skip-pkg-cache: true # golangci-lint can't work with this cache enabled, ref. https://github.com/golangci/golangci-lint-action/issues/135. - + uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master gomodcheck: name: Check internal dependencies runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 3262aa4e4..459a61908 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ testdata/ pkg/vm/testdata/fuzz !pkg/vm/testdata !pkg/wallet/testdata + +# Linter +.golangci.yml diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index cd3800d31..000000000 --- a/.golangci.yml +++ /dev/null @@ -1,74 +0,0 @@ -# This file contains all available configuration options -# with their default values. - -# options for analysis running -run: - # timeout for analysis, e.g. 30s, 5m, default is 1m - timeout: 5m - - # include test files or not, default is true - tests: true - -# output configuration options -output: - # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - formats: - - format: tab - -# all available settings of specific linters -linters-settings: - exhaustive: - # indicates that switch statements are to be considered exhaustive if a - # 'default' case is present, even if all enum members aren't listed in the - # switch - default-signifies-exhaustive: true - -linters: - enable: - # mandatory linters - - govet - - revive - - # some default golangci-lint linters - - errcheck - - gosimple - - godot - - ineffassign - - staticcheck - - typecheck - - unused - - # extra linters - # - exhaustive - # - goconst - # - goerr113 - # - gomnd - # - nonamedreturns - # - unparam - - bidichk - - bodyclose - - contextcheck - - decorder - - durationcheck - - errorlint - - intrange - - copyloopvar - - gofmt - - misspell - - predeclared - - reassign - - whitespace - - goimports - disable-all: true - fast: false - -issues: - include: - - EXC0002 # should have a comment - - EXC0003 # test/Test ... consider calling this - - EXC0004 # govet - - EXC0005 # C-style breaks - exclude-rules: - - linters: - - revive - text: "unused-parameter" diff --git a/Makefile b/Makefile index ac5111659..82194ce04 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,10 @@ test: vet: @go vet ./... -lint: +.golangci.yml: + curl -L -o $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml + +lint: .golangci.yml @golangci-lint run fmt: