forked from bobziuchkovski/digest
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from MihaiBojin/master
- Loading branch information
Showing
11 changed files
with
859 additions
and
47 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 @@ | ||
make all |
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,88 @@ | ||
linters-settings: | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 2 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- octalLiteral | ||
gocyclo: | ||
min-complexity: 15 | ||
golint: | ||
min-confidence: 0 | ||
govet: | ||
check-shadowing: true | ||
maligned: | ||
suggest-new: true | ||
misspell: | ||
locale: US | ||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- errcheck | ||
- exportloopref | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- golint | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- rowserrcheck | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- whitespace | ||
|
||
# don't enable: | ||
# - gochecknoinits | ||
# - funlen | ||
# - lll | ||
# - gomnd | ||
# - asciicheck | ||
# - gochecknoglobals | ||
# - gocognit | ||
# - godot | ||
# - godox | ||
# - goerr113 | ||
# - maligned | ||
# - nestif | ||
# - prealloc | ||
# - testpackage | ||
# - wsl | ||
|
||
run: | ||
tests: true | ||
build-tags: | ||
- e2e | ||
skip-dirs: | ||
- internal/mocks | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
- linters: | ||
- gosec | ||
text: "G501:" |
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 @@ | ||
golang 1.14 |
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 |
---|---|---|
|
@@ -15,3 +15,6 @@ | |
Bipasa Chattopadhyay <[email protected]> | ||
Eric Gavaletz <[email protected]> | ||
Seon-Wook Park <[email protected]> | ||
Eric Daniels <[email protected]> | ||
Gustavo Bazan <[email protected]> | ||
Mihai Bojin <[email protected]> |
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,52 @@ | ||
.PHONY: fmt | ||
fmt: ## Format the code | ||
@echo "==>" | ||
@echo "==> Formatting the code..." | ||
@gofmt -w -s . | ||
@goimports -w . | ||
|
||
@echo "==>" | ||
@echo "==> Running go mod tidy..." | ||
@go mod tidy | ||
|
||
|
||
.PHONY: lint | ||
lint: ## Lint the code | ||
@echo "==>" | ||
@echo "==> Linting all packages..." | ||
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run | ||
|
||
.PHONY: fix-lint | ||
fix-lint: ## Fix linting errors | ||
@echo "==>" | ||
@echo "==> Fixing lint errors" | ||
@go run github.com/golangci/golangci-lint/cmd/golangci-lint --fix | ||
|
||
.PHONY: build | ||
build: ## Build the library | ||
@echo "==>" | ||
@echo "==> Building the code" | ||
@go build ./... | ||
|
||
.PHONY: test | ||
test: ## Run the tests | ||
@echo "==>" | ||
@echo "==> Running tests" | ||
@go test ./... | ||
|
||
.PHONY: all | ||
all: fmt lint build test ## Run all targets | ||
|
||
.PHONY: link-git-hooks | ||
link-git-hooks: ## Install git hooks | ||
@echo "==>" | ||
@echo "==> Installing all git hooks..." | ||
@find .git/hooks -type l -exec rm {} \; | ||
@find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \; | ||
|
||
.PHONY: help | ||
.DEFAULT_GOAL := help | ||
help: | ||
@echo | ||
@echo "Makefile targets:" | ||
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$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
Oops, something went wrong.