mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +00:00
linter: use org-wide version of linter
Close #3591, Close #3417. Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
e1d5ac8557
commit
379ca4b4e6
4 changed files with 8 additions and 88 deletions
14
.github/workflows/tests.yml
vendored
14
.github/workflows/tests.yml
vendored
|
@ -15,19 +15,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
gomodcheck:
|
gomodcheck:
|
||||||
name: Check internal dependencies
|
name: Check internal dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -55,3 +55,6 @@ testdata/
|
||||||
pkg/vm/testdata/fuzz
|
pkg/vm/testdata/fuzz
|
||||||
!pkg/vm/testdata
|
!pkg/vm/testdata
|
||||||
!pkg/wallet/testdata
|
!pkg/wallet/testdata
|
||||||
|
|
||||||
|
# Linter
|
||||||
|
.golangci.yml
|
||||||
|
|
|
@ -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"
|
|
5
Makefile
5
Makefile
|
@ -109,7 +109,10 @@ test:
|
||||||
vet:
|
vet:
|
||||||
@go 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
|
@golangci-lint run
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
|
|
Loading…
Reference in a new issue