1
0
Fork 0
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:
AnastasiaShemyakinskaya 2022-12-05 13:06:52 +03:00
commit 09ad2a550a
No known key found for this signature in database
GPG key ID: CCD60ED83B103281
3 changed files with 98 additions and 0 deletions

22
.github/workflows/golangci-lint.yml vendored Normal file
View 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
View 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

View file

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