From 5cb2bceb2f439c9f2a984972afa58d0b810220fb Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 14 Feb 2019 20:48:10 -0600 Subject: [PATCH 1/3] blockchain: Fix typos found by misspell. --- blockchain/chaingen/generator.go | 2 +- blockchain/common_test.go | 2 +- blockchain/merkle.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockchain/chaingen/generator.go b/blockchain/chaingen/generator.go index d2db462037..3b04b48cac 100644 --- a/blockchain/chaingen/generator.go +++ b/blockchain/chaingen/generator.go @@ -1334,7 +1334,7 @@ func buildMerkleTreeStore(transactions []*dcrutil.Tx) []*chainhash.Hash { merkles[offset] = newHash // The normal case sets the parent node to the hash of the - // concatentation of the left and right children. + // concatenation of the left and right children. default: newHash := hashMerkleBranches(merkles[i], merkles[i+1]) merkles[offset] = newHash diff --git a/blockchain/common_test.go b/blockchain/common_test.go index bad2ebbed4..9d5f8545a0 100644 --- a/blockchain/common_test.go +++ b/blockchain/common_test.go @@ -230,7 +230,7 @@ func findDeployment(params *chaincfg.Params, voteID string) (uint32, *chaincfg.C return 0, nil, fmt.Errorf("unable to find deployement for id %q", voteID) } -// findDeploymentChoice finds the provided choice ID withing the given +// findDeploymentChoice finds the provided choice ID within the given // deployment params and either returns a pointer to the found choice or an // error when not found. func findDeploymentChoice(deployment *chaincfg.ConsensusDeployment, choiceID string) (*chaincfg.Choice, error) { diff --git a/blockchain/merkle.go b/blockchain/merkle.go index f8ed169b19..bd5b06f280 100644 --- a/blockchain/merkle.go +++ b/blockchain/merkle.go @@ -59,7 +59,7 @@ func populateMerkleStore(offset int, merkles []*chainhash.Hash) { merkles[offset] = newHash // The normal case sets the parent node to the hash of the - // concatentation of the left and right children. + // concatenation of the left and right children. default: newHash := HashMerkleBranches(merkles[i], merkles[i+1]) merkles[offset] = newHash From cf3f55f6b078f8c2b1ae4774a9d57fddcabf0dbc Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 14 Feb 2019 22:58:08 -0600 Subject: [PATCH 2/3] dcrutil: Fix typos found by misspell. --- dcrutil/address.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcrutil/address.go b/dcrutil/address.go index 6e328a00dc..60d764dd40 100644 --- a/dcrutil/address.go +++ b/dcrutil/address.go @@ -253,7 +253,7 @@ func NewAddressPubKeyHash(pkHash []byte, net *chaincfg.Params, algo dcrec.Signat // newAddressPubKeyHash is the internal API to create a pubkey hash address // with a known leading identifier byte for a network, rather than looking // it up through its parameters. This is useful when creating a new address -// structure from a string encoding where the identifer byte is already +// structure from a string encoding where the identifier byte is already // known. func newAddressPubKeyHash(pkHash []byte, netID [2]byte) (*AddressPubKeyHash, error) { // Check for a valid pubkey hash length. @@ -355,7 +355,7 @@ func NewAddressScriptHashFromHash(scriptHash []byte, // newAddressScriptHashFromHash is the internal API to create a script hash // address with a known leading identifier byte for a network, rather than // looking it up through its parameters. This is useful when creating a new -// address structure from a string encoding where the identifer byte is already +// address structure from a string encoding where the identifier byte is already // known. func newAddressScriptHashFromHash(scriptHash []byte, netID [2]byte) (*AddressScriptHash, error) { From a9fb05ba205aa41c208a5fdbd5e7a538f8c828f9 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 14 Feb 2019 20:53:11 -0600 Subject: [PATCH 3/3] travis: Add misspell linter. --- run_tests.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 35f019f12c..0a0a2d80bc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -16,7 +16,8 @@ set -ex # 2. gosimple (https://github.com/dominikh/go-simple) # 3. unconvert (https://github.com/mdempsky/unconvert) # 4. ineffassign (https://github.com/gordonklaus/ineffassign) -# 5. race detector (http://blog.golang.org/race-detector) +# 5. misspell (https://github.com/client9/misspell) +# 6. race detector (http://blog.golang.org/race-detector) # golangci-lint (github.com/golangci/golangci-lint) is used to run each each # static checker. @@ -58,7 +59,8 @@ testrepo () { --enable=gofmt \ --enable=gosimple \ --enable=unconvert \ - --enable=ineffassign ./${module}/... + --enable=ineffassign \ + --enable=misspell ./${module}/... done echo "------------------------------------------"