forked from dasrick/go-teams-notify
-
Notifications
You must be signed in to change notification settings - Fork 17
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 #9 from dasrick/v2
v2
- Loading branch information
Showing
11 changed files
with
149 additions
and
161 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,87 @@ | ||
linters: | ||
enable: | ||
- dogsled | ||
- dupl | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- golint | ||
- gosec | ||
- maligned | ||
- nakedret | ||
- prealloc | ||
- scopelint | ||
- unconvert | ||
- unparam | ||
- whitespace | ||
|
||
linters-settings: | ||
funlen: | ||
lines: 60 | ||
statements: 40 | ||
|
||
gocognit: | ||
# minimal code complexity to report, 30 by default (but we recommend 10-20) | ||
min-complexity: 10 | ||
|
||
gocyclo: | ||
# minimal code complexity to report, 30 by default (but we recommend 10-20) | ||
min-complexity: 10 | ||
|
||
golint: | ||
# minimal confidence for issues, default is 0.8 | ||
min-confidence: 0.3 | ||
|
||
maligned: | ||
# print struct with more effective memory layout or not, false by default | ||
suggest-new: true | ||
|
||
nakedret: | ||
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30 | ||
max-func-lines: 2 | ||
|
||
unparam: | ||
# Inspect exported functions, default is false. Set to true if no external program/library imports your code. | ||
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: | ||
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations | ||
# with golangci-lint call it on a directory with the changed file. | ||
check-exported: true | ||
|
||
unused: | ||
# treat code as a program (not a library) and report unused exported identifiers; default is false. | ||
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors: | ||
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations | ||
# with golangci-lint call it on a directory with the changed file. | ||
check-exported: false | ||
|
||
whitespace: | ||
# Enforces newlines (or comments) after every multi-line if statement | ||
multi-if: true | ||
# Enforces newlines (or comments) after every multi-line function signature | ||
multi-func: true | ||
|
||
issues: | ||
# Not using default exclusions because we want to require comments on public | ||
# functions and types. | ||
exclude-use-default: false | ||
|
||
# options for analysis running | ||
run: | ||
# include test files or not, default is true | ||
tests: false | ||
|
||
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": | ||
# If invoked with -mod=readonly, the go command is disallowed from the implicit | ||
# automatic updating of go.mod described above. Instead, it fails when any changes | ||
# to go.mod are needed. This setting is most useful to check that go.mod does | ||
# not need updates, such as in a continuous integration and testing system. | ||
# If invoked with -mod=vendor, the go command assumes that the vendor | ||
# directory holds the correct copies of dependencies and ignores | ||
# the dependency descriptions in go.mod. | ||
modules-download-mode: vendor | ||
|
||
service: | ||
# use the fixed version to not introduce new linters unexpectedly | ||
golangci-lint-version: 1.20.x |
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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# This is a weird way of telling Travis to use the fast container-based test | ||
# runner instead of the slow VM-based runner. | ||
sudo: false | ||
dist: bionic | ||
|
||
language: go | ||
|
||
go: | ||
- 1.12.x | ||
- 1.13.x | ||
- 1.14.x | ||
|
||
before_script: | ||
- go get -u golang.org/x/lint/golint | ||
- go get -u github.com/golang/dep/cmd/dep | ||
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin | ||
- go get golang.org/x/tools/cmd/cover | ||
- go get github.com/mattn/goveralls | ||
|
||
script: | ||
- make install | ||
- make lint | ||
- make test | ||
- make race | ||
- make coverage | ||
- go test $(shell go list ./... | grep -v /vendor/) -race -coverprofile=coverage.txt -covermode=atomic | ||
|
||
after_success: | ||
- $GOPATH/bin/goveralls -service=travis-ci | ||
- bash <(curl -s https://codecov.io/bash) | ||
- if if [[ $TRAVIS_GO_VERSION == 1.14* ]]; $GOPATH/bin/goveralls -service=travis-ci ; fi | ||
- if if [[ $TRAVIS_GO_VERSION == 1.14* ]]; bash <(curl -s https://codecov.io/bash) ; fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,32 +1,43 @@ | ||
LIST_ALL := $(shell go list ./... | grep -v /vendor/) | ||
|
||
# Force using Go Modules and always read the dependencies from | ||
# the `vendor` folder. | ||
export GO111MODULE = on | ||
#export GOFLAGS = -mod=vendor | ||
|
||
.PHONY: all lint test race coverage report dep help | ||
all: lint test | ||
|
||
.PHONY: install | ||
install: ## Install the dependencies | ||
@go mod vendor | ||
|
||
all: lint test | ||
.PHONY: update | ||
update: ## Update the dependencies | ||
@go mod tidy | ||
|
||
.PHONY: clean | ||
clean: ## Remove binaries and ZIP files based on directory `./cmd/` | ||
@rm -rf "$(go env GOCACHE)" | ||
@rm -f coverage.out | ||
|
||
lint: ## Lint all files | ||
.PHONY: lint | ||
lint: ## Lint all files (via golangci-lint) | ||
@go fmt ${LIST_ALL} | ||
@golint -set_exit_status ${LIST_ALL} | ||
@golangci-lint run | ||
|
||
test: dep ## Run unittests | ||
@go test -short ${LIST_ALL} | ||
.PHONY: test | ||
test: clean ## Run unit tests (incl. race and coverprofile) | ||
@go test -race -cover -short -timeout=90s -coverprofile=coverage.out ${LIST_ALL} | ||
|
||
race: dep ## Run data race detector | ||
@go test -race -short ${LIST_ALL} | ||
|
||
coverage: dep # Generate coverage report | ||
@go test ${LIST_ALL} -coverprofile coverage.out | ||
.PHONY: coverage | ||
coverage: test ## Generate coverage report | ||
@go tool cover -func coverage.out | ||
|
||
report: coverage # Open the coverage report in browser | ||
.PHONY: report | ||
report: coverage ## Open the coverage report in browser | ||
@go tool cover -html=coverage.out | ||
|
||
|
||
dep: ## Get the dependencies | ||
@dep ensure | ||
# ---------------------------------------------------------------------------------------------------------------------- | ||
|
||
help: ## Display this help screen | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/dasrick/go-teams-notify/v2 | ||
|
||
go 1.14 | ||
|
||
require github.com/stretchr/testify v1.5.1 |
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,12 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= | ||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= | ||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.