linter: use org-wide version of linter

Close #3591,
Close #3417.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-09-25 21:45:02 +03:00
parent e1d5ac8557
commit 379ca4b4e6
4 changed files with 8 additions and 88 deletions

View file

@ -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

3
.gitignore vendored
View file

@ -55,3 +55,6 @@ testdata/
pkg/vm/testdata/fuzz
!pkg/vm/testdata
!pkg/wallet/testdata
# Linter
.golangci.yml

View file

@ -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"

View file

@ -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: