forked from deanishe/awgo
-
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.
[skip ci]
- Loading branch information
Showing
20 changed files
with
156 additions
and
38 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,37 @@ | ||
[run] | ||
deadline = "5m" | ||
|
||
[linters] | ||
disable-all = true | ||
enable = [ | ||
"deadcode", | ||
"goconst", | ||
"gofmt", | ||
"goimports", | ||
"ineffassign", | ||
"scopelint", | ||
"staticcheck", | ||
"stylecheck", | ||
"unconvert", | ||
"unused", | ||
# "maligned", | ||
# "lll", | ||
# "prealloc", | ||
] | ||
|
||
[linter-settings] | ||
[linter-settings.errcheck] | ||
check-blank = true | ||
check-type-assertions = true | ||
|
||
[linter-settings.goimports] | ||
local-prefixes = "github.com/deanishe/awgo" | ||
|
||
[issues] | ||
max-same-issues = 50 | ||
max-issues-per-linter = 50 | ||
# exclude = ['ST1005'] | ||
|
||
[[issues.exclude-rules]] | ||
linters = ['stylecheck'] | ||
text = "ST1005:" |
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,73 @@ | ||
# Go | ||
# Build your Go project. | ||
# Add steps that test, save build artifacts, deploy, and more: | ||
# https://docs.microsoft.com/azure/devops/pipelines/languages/go | ||
|
||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'macOS-10.13' | ||
|
||
variables: | ||
GOBIN: '$(GOPATH)/bin' # Go binaries path | ||
GOROOT: '/usr/local/opt/go/libexec' # Go installation path | ||
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path | ||
BUILD_NUMBER: '$(Build.BuildNumber)' | ||
CI_PULL_REQUEST: '$(Build.SourceBranch)' | ||
CI_PKG_NAME: 'github.com/$(Build.Repository.Name)' | ||
PR_COMMIT: '$(System.PullRequest.SourceCommitId)' | ||
BASE_COMMIT: '$(Build.SourceVersion)' | ||
CODACY_TOKEN: '$(CodacyToken)' | ||
CODECOV_TOKEN: '$(CodeCovToken)' | ||
# COVERALLS_TOKEN: '$(CoverallsToken)' | ||
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code | ||
|
||
steps: | ||
- script: | | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
shopt -s extglob | ||
shopt -s dotglob | ||
mv !(gopath) '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
go version | ||
displayName: 'Set up Go' | ||
|
||
- script: | | ||
go get -v -t -d ./... | ||
workingDirectory: '$(modulePath)' | ||
displayName: Fetch Code | ||
|
||
- script: | | ||
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v1.20.1/golangci-lint-1.20.1-darwin-amd64.tar.gz | tar -C '$(GOBIN)' -xz --strip-components=1 --include='*golangci-lint' | ||
golangci-lint run -c .golangci.toml | ||
workingDirectory: '$(modulePath)' | ||
displayName: Lint | ||
|
||
- script: | | ||
./run-tests.sh -ic ./... | ||
workingDirectory: '$(modulePath)' | ||
displayName: Run Tests | ||
|
||
# Coveralls doesn't work with Azure | ||
# - displayName: Coveralls | ||
# script: | | ||
# go get github.com/mattn/goveralls | ||
# goveralls -coverprofile=coverage.out -service=local; true | ||
# workingDirectory: '$(modulePath)' | ||
# displayName: 'coveralls.io' | ||
- script: | | ||
echo "PR_COMMIT=$PR_COMMIT" | ||
echo "BASE_COMMIT=$BASE_COMMIT" | ||
go get github.com/schrej/godacov | ||
if [[ "$PR_COMMIT" != "" ]]; then | ||
godacov -r coverage.out -t $(CODACY_TOKEN) -c $(PR_COMMIT); true | ||
else | ||
godacov -r coverage.out -t $(CODACY_TOKEN) -c $(BASE_COMMIT); true | ||
fi | ||
bash <(curl -s https://codecov.io/bash); true | ||
workingDirectory: '$(modulePath)' | ||
displayName: Coverage |
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
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.