-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable additional linters #589
Open
faddat
wants to merge
17
commits into
CosmWasm:main
Choose a base branch
from
faddat:faddat/bump-go
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+473
−273
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9404e32
testifylint execpt for the MockInfoBin
faddat 3eb0c97
gci'd
faddat 64e241e
continue test cleanup
faddat 675f892
gci is much better than goimports
faddat 1921179
use latest linter
faddat f8005f8
resolve issues with goroutine
faddat 445f165
enable errcheck and thelper linters
faddat fdaf809
enable additional linters
faddat bd565b4
correct typo from adjusting tests.
faddat 016154b
Merge branch 'faddat/testifylint' into faddat/bump-go
faddat 71b2d1e
adjust golang version in circleci
faddat f371399
bump go...
faddat cbde717
remove dupl
faddat 08ea4c4
lint main.go
faddat 7a812f5
lints...
faddat 65039a5
complete
faddat ada59f4
Merge branch 'main' into faddat/bump-go
faddat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,10 +1,83 @@ | ||
run: | ||
tests: true | ||
timeout: 5m | ||
skip-dirs: | ||
- vendor/ | ||
- third_party/ | ||
|
||
linters: | ||
# Enable specific linter | ||
# https://golangci-lint.run/usage/linters/#enabled-by-default | ||
enable: | ||
- gofumpt | ||
- goimports | ||
- errcheck # Detect unchecked errors | ||
- gosimple # Simplify code | ||
- govet # Reports suspicious constructs | ||
- ineffassign # Detect unused assignments | ||
- staticcheck # Go static analysis | ||
- typecheck # Go type checker | ||
- unused # Detect unused constants, variables, functions and types | ||
|
||
# Additional recommended linters | ||
- gocritic # A more opinionated linter | ||
- gosec # Security checker | ||
- misspell # Find commonly misspelled words | ||
- revive # a metalinter with more checks | ||
- bodyclose # Check HTTP response bodies are closed | ||
- goconst # Find repeated strings that could be constants | ||
# - gocyclo # Check function complexity | ||
- godot # Check comment endings | ||
- gocognit # Check cognitive complexity | ||
- whitespace # Check trailing whitespace | ||
- thelper # Detect test helpers not using t.Helper() | ||
- tparallel # Detect incorrect usage of t.Parallel() | ||
|
||
linters-settings: | ||
goimports: | ||
local-prefixes: github.com/CosmWasm/wasmvm | ||
gci: | ||
# Section configuration to compare against. | ||
# Section names are case-insensitive and may contain parameters in (). | ||
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`, | ||
# If `custom-order` is `true`, it follows the order of `sections` option. | ||
# Default: ["standard", "default"] | ||
sections: | ||
- standard # Standard section: captures all standard packages. | ||
- default # Default section: contains all imports that could not be matched to another section type. | ||
- prefix(github.com/cosmos/cosmos-sdk) # Custom section: groups all imports with the specified Prefix. | ||
- prefix(github.com/cosmos/ibc-go) | ||
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. | ||
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. | ||
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled. | ||
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled. | ||
# Skip generated files. | ||
# Default: true | ||
skip-generated: false | ||
# Enable custom order of sections. | ||
# If `true`, make the section order the same as the order of `sections`. | ||
# Default: false | ||
custom-order: true | ||
# Drops lexical ordering for custom sections. | ||
# Default: false | ||
no-lex-order: true | ||
gocritic: | ||
# Enable all gocritic checks. | ||
disabled-checks: | ||
- dupSubExpr | ||
gocyclo: | ||
min-complexity: 15 | ||
gocognit: | ||
min-complexity: 20 | ||
dupl: | ||
threshold: 100 | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
revive: | ||
rules: | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming | ||
- name: var-naming | ||
severity: warning | ||
disabled: true | ||
|
||
issues: | ||
exclude-use-default: false | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/CosmWasm/wasmvm/v2 | ||
|
||
go 1.21 | ||
go 1.23 | ||
|
||
require ( | ||
github.com/google/btree v1.0.0 | ||
|
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required for the linters?