-
Notifications
You must be signed in to change notification settings - Fork 56
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 #376 from tendermint/alessio/add-linter
Add linter
- Loading branch information
Showing
40 changed files
with
717 additions
and
654 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,22 @@ | ||
name: Lint | ||
# Lint runs golangci-lint over the entire cosmos-sdk 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: | ||
- develop | ||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 6 | ||
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.40 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
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 | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- exportloopref | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- unparam | ||
- misspell | ||
# - wsl | ||
- nolintlint | ||
|
||
issues: | ||
exclude-rules: | ||
- text: "Use of weak random number generator" | ||
linters: | ||
- gosec | ||
- text: "comment on exported var" | ||
linters: | ||
- golint | ||
- text: "don't use an underscore in package name" | ||
linters: | ||
- golint | ||
- text: "ST1003:" | ||
linters: | ||
- stylecheck | ||
# FIXME: Disabled until golangci-lint updates stylecheck with this fix: | ||
# https://github.com/dominikh/go-tools/issues/389 | ||
- text: "ST1016:" | ||
linters: | ||
- stylecheck | ||
- path: "legacy" | ||
text: "SA1019:" | ||
linters: | ||
- staticcheck | ||
- text: "ifElseChain:" | ||
linters: | ||
- gocritic | ||
|
||
max-issues-per-linter: 10000 | ||
max-same-issues: 10000 | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
maligned: | ||
# print struct with more effective memory layout or not, false by default | ||
suggest-new: true | ||
nolintlint: | ||
allow-unused: false | ||
allow-leading-space: true | ||
require-explanation: false | ||
require-specific: false |
Oops, something went wrong.