mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
Merge branch 'master' of github.com:anytypeio/go-anytype-middleware into prod-344-notion-api
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
This commit is contained in:
commit
09ad2a550a
3 changed files with 98 additions and 0 deletions
22
.github/workflows/golangci-lint.yml
vendored
Normal file
22
.github/workflows/golangci-lint.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: golangci-lint
|
||||
on:
|
||||
pull_request:
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
golangci:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.18
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: latest
|
||||
only-new-issues: true
|
||||
args: --timeout 15m
|
58
.golangci.yml
Normal file
58
.golangci.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
un:
|
||||
deadline: 15m
|
||||
timeout: 15m
|
||||
# didn't run linter on tests
|
||||
tests: false
|
||||
# don't check generated protobuf files
|
||||
skip-dirs:
|
||||
- pb/external_libs
|
||||
- pkg/lib/pb
|
||||
go: '1.18'
|
||||
|
||||
linters-settings:
|
||||
errcheck:
|
||||
check-blank: true
|
||||
errchkjson:
|
||||
report-no-exported: true
|
||||
gci:
|
||||
sections:
|
||||
- standard
|
||||
- default
|
||||
- prefix(github.com/anytypeio/go-anytype-middleware)
|
||||
- blank
|
||||
- dot
|
||||
skip-generated: false
|
||||
custom-order: true
|
||||
goimports:
|
||||
local-prefixes: github.com/anytypeio/go-anytype-middleware
|
||||
govet:
|
||||
check-shadowing: true
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- dupl
|
||||
- gci
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- gosec
|
||||
- interfacebloat
|
||||
- importas
|
||||
- lll
|
||||
- misspell
|
||||
- nestif
|
||||
- prealloc
|
||||
- revive
|
||||
- wsl
|
||||
- unused
|
||||
- errcheck
|
||||
- funlen
|
||||
- gosimple
|
||||
- govet
|
||||
- typecheck
|
||||
- stylecheck
|
||||
- unconvert
|
||||
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
18
Makefile
18
Makefile
|
@ -1,4 +1,5 @@
|
|||
export GOPRIVATE=github.com/anytypeio
|
||||
export GOLANGCI_LINT_VERSION=v1.49.0
|
||||
|
||||
ifndef $(GOPATH)
|
||||
GOPATH=$(shell go env GOPATH)
|
||||
|
@ -241,3 +242,20 @@ endif
|
|||
|
||||
build-js: setup-go build-server protos-js
|
||||
@echo "Run 'make install-dev-js' instead if you want to build&install into ../js-anytype"
|
||||
|
||||
install-linter:
|
||||
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
|
||||
|
||||
run-linter:
|
||||
ifdef GOLANGCI_LINT_BRANCH
|
||||
@golangci-lint run -v ./... --new-from-rev=$(GOLANGCI_LINT_BRANCH) --timeout 15m
|
||||
else
|
||||
@golangci-lint run -v ./... --new-from-rev=master --timeout 15m
|
||||
endif
|
||||
|
||||
run-linter-fix:
|
||||
ifdef GOLANGCI_LINT_BRANCH
|
||||
@golangci-lint run -v ./... --new-from-rev=$(GOLANGCI_LINT_BRANCH) --timeout 15m --fix
|
||||
else
|
||||
@golangci-lint run -v ./... --new-from-rev=master --timeout 15m --fix
|
||||
endif
|
Loading…
Add table
Add a link
Reference in a new issue