-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add golangci-lint * fix messed up go mod * add readme chunk * go 1.18 * add go workspace to make vscode happy * vendorSha256 changed again apparently * dont try to install golangci lint * go work sync * fix vendorSha256 again for some reason * fix go 1.18 linter warnings
- Loading branch information
1 parent
27b129a
commit 5508573
Showing
27 changed files
with
1,790 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
push: | ||
workflow_call: | ||
|
||
jobs: | ||
golangci: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.46.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
linters: | ||
# Disable all linters. | ||
# Default: false | ||
disable-all: true | ||
# Enable specific linter | ||
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters | ||
enable: | ||
- depguard | ||
- dogsled | ||
- errcheck | ||
- exportloopref | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- goprintffuncname | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- staticcheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- varcheck | ||
- whitespace | ||
|
||
# linters disabled because of go1.18 (see https://github.com/golangci/golangci-lint/issues/2649): | ||
# - bodyclose | ||
# - noctx | ||
# - structcheck | ||
|
||
# don't enable: | ||
# - wsl | ||
# - gochecknoinits | ||
# - gomnd | ||
|
||
# Options for analysis running. | ||
run: | ||
skip-files: | ||
- "internal/pb/*.pb.go$" | ||
- internal/pb/object.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"go.lintTool":"golangci-lint", | ||
"go.lintFlags": [ | ||
"--fast" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,18 @@ INTERNAL_GO_FILES := $(shell find internal/ -type f -name '*.go') | |
MIGRATE_DIR := ./migrations | ||
SERVICE := $(PROJECT).server | ||
|
||
TOOLS_DIR := tools | ||
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin | ||
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint | ||
|
||
.PHONY: install migrate migrate-create build release test | ||
.PHONY: reset-db setup-local server server-profile client-update client-get client-rebuild client-pack health | ||
.PHONY: k8s-clear k8s-build k8s-deploy k8s-client-update k8s-client-get k8s-client-rebuild k8s-client-pack k8s-health | ||
.PHONY: upload-container-image | ||
|
||
$(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod | ||
cd $(TOOLS_DIR) && go build -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
install: | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
|
@@ -215,3 +222,6 @@ load-test-get: | |
|
||
load-test-update: | ||
$(call load-test,Update,update_increment.json,10000,1) | ||
|
||
lint: $(GOLANGCI_LINT) | ||
$(GOLANGCI_LINT) run ./... --fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.