-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 #265 from marbar3778/marko/linting
ci: add linting & lint fixes
- Loading branch information
Showing
40 changed files
with
765 additions
and
628 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 |
---|---|---|
@@ -1,55 +1,55 @@ | ||
name: BUILD - lint, build and binary upload | ||
name: BUILD - build and binary upload | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Install and setup go | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14 | ||
id: go | ||
|
||
# setup gopath | ||
- name: Set PATH | ||
run: | | ||
echo "::set-env name=GOPATH::$(go env GOPATH)" | ||
echo "::add-path::$(go env GOPATH)/bin" | ||
shell: bash | ||
|
||
# # install linter | ||
# - name: install linter | ||
# run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.24.0 | ||
|
||
# checkout relayer | ||
- name: checkout relayer | ||
uses: actions/checkout@v2 | ||
|
||
# setup cache | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
# # run linter | ||
# - name: linter | ||
# run: make ci-lint | ||
|
||
# build binary | ||
- name: build binary and move to upload location | ||
run: make build | ||
|
||
# upload resulting binaries | ||
- name: upload binaries | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: rly | ||
path: ./build/rly | ||
# Install and setup go | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
# setup gopath | ||
- name: Set PATH | ||
run: | | ||
echo "::add-path::$(go env GOPATH)/bin" | ||
shell: bash | ||
|
||
# checkout relayer | ||
- name: checkout relayer | ||
uses: actions/checkout@v2 | ||
|
||
# setup cache | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
# build binary | ||
- name: build binary and move to upload location | ||
run: make build | ||
|
||
# upload resulting binaries | ||
- name: upload binaries | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: rly | ||
path: ./build/rly | ||
|
||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: golangci/golangci-lint-action@master | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.27 | ||
args: --timeout 10m | ||
github-token: ${{ secrets.github_token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
linters: | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
# - errcheck | ||
# - funlen | ||
# - gochecknoglobals | ||
# - gochecknoinits | ||
- goconst | ||
- gocritic | ||
# - gocyclo | ||
# - godox | ||
- gofmt | ||
- goimports | ||
- golint | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- lll | ||
- misspell | ||
# - maligned | ||
- nakedret | ||
- prealloc | ||
- scopelint | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
# - unparam | ||
- unused | ||
- varcheck | ||
# - whitespace | ||
# - wsl | ||
# - gocognit | ||
- nolintlint | ||
|
||
issues: | ||
exclude-rules: | ||
- linters: | ||
- lll | ||
source: "https://" | ||
max-same-issues: 50 | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
maligned: | ||
suggest-new: true | ||
# govet: | ||
# check-shadowing: true | ||
golint: | ||
min-confidence: 0 | ||
# gocyclo: | ||
# min-complexity: 10 | ||
# misspell: | ||
# locale: US |
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.