-
Notifications
You must be signed in to change notification settings - Fork 551
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 #1 from tendermint/marko/add_linting
add linter and add linting in ci
- Loading branch information
Showing
6 changed files
with
90 additions
and
19 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,29 @@ | ||
name: Lint | ||
# Lint runs golangci-lint over the entire repository | ||
# This workflow is run on every pull request and push to master | ||
# The `golangci` will pass without running if no *.{go, mod, sum} files have been changed. | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 6 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/get-diff-action@v1 | ||
with: | ||
SUFFIX_FILTER: | | ||
.go | ||
.mod | ||
.sum | ||
- 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 }} | ||
if: "env.GIT_DIFF != ''" |
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,42 @@ | ||
run: | ||
tests: false | ||
# # timeout for analysis, e.g. 30s, 5m, default is 1m | ||
# timeout: 5m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
# - errcheck | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- golint | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- maligned | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- scopelint | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- unparam | ||
- misspell | ||
# - wsl | ||
- nolintlint | ||
|
||
issues: | ||
max-issues-per-linter: 10000 | ||
max-same-issues: 10000 |
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