Skip to content

Commit

Permalink
style: fix lint errors and update lint timeout (#9464)
Browse files Browse the repository at this point in the history
* fix: misc fixes for make to work off freshly cloned repo

* gocritic appendAssign fix

* markdown trailing space and blank line fixes

* change golangci-lint timeout to 5min

* update changelog

* Update .golangci.yml

Co-authored-by: Ryan Christoffersen <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Ryan Christoffersen <[email protected]>

Co-authored-by: Ryan Christoffersen <[email protected]>
Co-authored-by: Amaury <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jun 8, 2021
1 parent 37fc37d commit 98cf72c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run:
tests: false
# # timeout for analysis, e.g. 30s, 5m, default is 1m
# timeout: 5m
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m

linters:
disable-all: true
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

* [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`.
* [\#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Removed bank keeper's `k.setBalances` and `k.clearBalances`. Added `k.initBalances`.
* [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors.
* [\#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P
Expand Down
6 changes: 2 additions & 4 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/DOC_WRITING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
+ Follow Google developer documentation [style guide](https://developers.google.com/style).
+ Check the meaning of words in Microsoft's [A-Z word list and term collections](https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms) (use the search input!).



## Technical Writing Course

Google provides a free [course](https://developers.google.com/tech-writing/overview) for technical writing.
2 changes: 1 addition & 1 deletion docs/core/encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ The above `Profile` example is a fictive example used for educational purposes.
- the `AccountI` interface for encodinig different types of accounts (similar to the above example) in the x/auth query responses,
- the `Evidencei` interface for encoding different types of evidences in the x/evidence module,
- the `AuthorizationI` interface for encoding different types of x/authz authorizations,
- the [`Validator`](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/x/staking/types/staking.pb.go#L306-L337) struct that contains information about a validator.
- the [`Validator`](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/x/staking/types/staking.pb.go#L306-L337) struct that contains information about a validator.

A real-life example of encoding the pubkey as `Any` inside the Validator struct in x/staking is shown in the following example:

Expand Down
2 changes: 1 addition & 1 deletion server/rosetta/lib/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ func (e *MyError) Error() string {
}
func (e *MyError) Is(err error) bool {
return true
}
}
3 changes: 2 additions & 1 deletion x/distribution/legacy/v043/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ func MigratePrefixAddress(store sdk.KVStore, prefixBz []byte) {

for ; oldStoreIter.Valid(); oldStoreIter.Next() {
addr := oldStoreIter.Key()
newStoreKey := append(prefixBz, address.MustLengthPrefix(addr)...)
var newStoreKey []byte = prefixBz
newStoreKey = append(newStoreKey, address.MustLengthPrefix(addr)...)

// Set new key on store. Values don't change.
store.Set(newStoreKey, oldStoreIter.Value())
Expand Down

0 comments on commit 98cf72c

Please sign in to comment.