-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
5,401 additions
and
0 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,23 @@ | ||
version: 2.1 | ||
jobs: | ||
test: | ||
docker: | ||
- image: golang:1.14 | ||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Lint | ||
command: | | ||
make lint | ||
- run: | ||
name: Test | ||
command: | | ||
make test | ||
workflows: | ||
test: | ||
jobs: | ||
- test | ||
|
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: "\U0001F41B Bug report" | ||
about: Create a report to help us improve | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. |
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,14 @@ | ||
--- | ||
name: "\U0001F680 Feature request" | ||
about: Suggest an idea for this project | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
Empty file.
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,86 @@ | ||
run: | ||
timeout: 2m | ||
tests: false | ||
skip-dirs: | ||
- assets | ||
- dev | ||
- proto | ||
- mocks | ||
|
||
issues: | ||
exclude-rules: | ||
- text: declaration of "err" shadows declaration | ||
linters: | ||
- govet | ||
|
||
linters-settings: | ||
govet: | ||
check-shadowing: true | ||
golint: | ||
min-confidence: 0 | ||
gocyclo: | ||
min-complexity: 20 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 150 | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
misspell: | ||
locale: US | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- whyNoLint | ||
- commentedOutCode | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- dupl | ||
- errcheck | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- golint | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- scopelint | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- whitespace | ||
- wsl | ||
|
||
# don't enable: | ||
# - funlen | ||
# - gochecknoglobals | ||
# - gochecknoinits | ||
# - godox | ||
# - gocognit | ||
# - gomnd | ||
# - lll | ||
# - maligned |
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,11 @@ | ||
{ | ||
"github": { | ||
"release": true | ||
}, | ||
"npm": { | ||
"publish": false | ||
}, | ||
"git": { | ||
"tagName": "v${version}" | ||
} | ||
} |
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,4 @@ | ||
FROM golang:1.14 | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download |
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,60 @@ | ||
CURRENTPACKAGE := github.com/Syncano/pkg-go | ||
EXECNAME := orion | ||
|
||
PATH := $(PATH):$(GOPATH)/bin | ||
GOFILES=$(shell find . -mindepth 2 -type f -name '*.go' ! -path "./.*" ! -path "./dev/*" ! -path "*/proto/*") | ||
GOTESTPACKAGES = $(shell find . -mindepth 2 -type f -name '*.go' ! -path "./.*" ! -path "./internal/*" ! -path "./dev/*" ! -path "*/mocks/*" ! -path "*/proto/*" | xargs -n1 dirname | sort | uniq) | ||
|
||
.PHONY: help clean lint fmt test stest cov goconvey lint-in-docker test-in-docker generate | ||
.DEFAULT_GOAL := help | ||
$(VERBOSE).SILENT: | ||
|
||
help: | ||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
require-%: | ||
if ! hash ${*} 2>/dev/null; then \ | ||
echo "! ${*} not installed"; \ | ||
exit 1; \ | ||
fi | ||
|
||
clean: ## Cleanup repository | ||
go clean ./... | ||
rm -f build/$(EXECNAME) | ||
find deploy -name "*.unenc" -delete | ||
git clean -f | ||
|
||
lint: ## Run lint checks | ||
echo "=== lint ===" | ||
if ! hash golangci-lint 2>/dev/null; then \ | ||
echo "Installing golangci-lint"; \ | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $$(go env GOPATH)/bin v1.24.0; \ | ||
fi | ||
golangci-lint run $(ARGS) | ||
|
||
fmt: ## Format code through goimports | ||
gofmt -s -w $(GOFILES) | ||
go run golang.org/x/tools/cmd/goimports -local $(CURRENTPACKAGE) -w $(GOFILES) | ||
|
||
test: ## Run unit with race check and create coverage profile | ||
echo "=== unit test ===" | ||
echo "mode: atomic" > coverage-all.out | ||
$(foreach pkg,$(GOTESTPACKAGES),\ | ||
go test -timeout 5s -short -race -coverprofile=coverage.out -covermode=atomic $(ARGS) $(pkg) || exit;\ | ||
tail -n +2 coverage.out >> coverage-all.out 2>/dev/null;) | ||
|
||
cov: ## Show per function coverage generated by test | ||
echo "=== coverage ===" | ||
go tool cover -func=coverage-all.out | ||
|
||
goconvey: ## Run goconvey test server | ||
go run github.com/smartystreets/goconvey -excludedDirs "dev,internal,mocks,proto,assets,deploy,build" -timeout 5s -depth 2 | ||
|
||
lint-in-docker: require-docker-compose ## Run lint in docker environment | ||
docker-compose run --no-deps --rm server make lint | ||
|
||
test-in-docker: require-docker-compose ## Run full test suite in docker environment | ||
docker-compose run --rm server make build test | ||
|
||
generate: ## Run go generate | ||
go generate ./... |
Oops, something went wrong.