Add golangci lint check on pull requests (#645)

* added golangci lint check on pull requests

* changelog update

* updated to use circleci instead of github actions

* testing a golang change

* added workflow

* updated how we find the golangci command in the make file

* using orb for golangci

* Added golangci install make command

* use docker image for golangci

* stop using make in circleci

* reverted golang change to trigger ci

* gofmt

* make fmt

* fixed a few things

* updated version on golintci

* fixed all the lint errors

* check version

* skipped wrongly failing lint

* Revert generated file changes

* fix import grouping, return errors on failures, initialization of arrays revert

* fixed a few lint errors

* addressed more code review comments

* updated with error check

* increased timeout for golangci-lint

* dont format autogenerated files

Co-authored-by: Carlton Hanna <channa@figure.com>
This commit is contained in:
fkneeland-figure
2021-10-25 01:09:47 -06:00
committed by GitHub
parent c34b4863b1
commit 57517b0c33
44 changed files with 282 additions and 243 deletions

View File

@@ -208,18 +208,24 @@ func createRandomAccounts(accNum int) []sdk.AccAddress {
// createIncrementalAccounts is a strategy used by addTestAddrs() in order to generated addresses in ascending order.
func createIncrementalAccounts(accNum int) []sdk.AccAddress {
var addresses []sdk.AccAddress
addresses := make([]sdk.AccAddress, 0, accNum)
var buffer bytes.Buffer
// start at 100 so we can make up to 999 test addresses with valid test addresses
for i := 100; i < (accNum + 100); i++ {
numString := strconv.Itoa(i)
buffer.WriteString("A58856F0FD53BF058B4909A21AEC019107BA6") //base address string
buffer.WriteString("A58856F0FD53BF058B4909A21AEC019107BA6") // base address string
buffer.WriteString(numString) //adding on final two digits to make addresses unique
res, _ := sdk.AccAddressFromHex(buffer.String())
buffer.WriteString(numString) // adding on final two digits to make addresses unique
res, err := sdk.AccAddressFromHex(buffer.String())
if err != nil {
panic(err)
}
bech := res.String()
addr, _ := TestAddr(buffer.String(), bech)
addr, err := TestAddr(buffer.String(), bech)
if err != nil {
panic(err)
}
addresses = append(addresses, addr)
buffer.Reset()
@@ -409,7 +415,7 @@ func incrementAllSequenceNumbers(initSeqNums []uint64) {
// CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey {
var publicKeys []cryptotypes.PubKey
publicKeys := make([]cryptotypes.PubKey, 0, numPubKeys)
var buffer bytes.Buffer
// start at 10 to avoid changing 1 to 01, 2 to 02, etc