diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml index 8378c5b..5f3497a 100644 --- a/.github/workflows/audit.yaml +++ b/.github/workflows/audit.yaml @@ -43,13 +43,7 @@ jobs: run: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Run staticcheck - env: - LINT: "//lint:file-ignore SA1019 Ignore all deprecation errors, it's generated" run: | - # Add lint-ignore comment to beginning of files - sed -i "1i${LINT}" ./x/asset/types/query.pb.gw.go - sed -i "1i${LINT}" ./x/machine/types/query.pb.gw.go - sed -i "1i${LINT}" ./x/dao/types/query.pb.gw.go staticcheck ./... - name: Install golangci-lint diff --git a/app/genesis.go b/app/genesis.go index 5bf0c1d..68c9d64 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" ) -// The genesis state of the blockchain is represented here as a map of raw json -// messages key'd by a identifier string. +// GenesisState The genesis state of the blockchain is represented here as a +// map of raw json messages key'd by a identifier string. // The identifier is used to determine which module genesis information belongs // to so it may be appropriately routed during init chain. // Within this application default genesis information is retrieved from diff --git a/config/config.go b/config/config.go index 92ac4d3..e49aaa4 100644 --- a/config/config.go +++ b/config/config.go @@ -102,7 +102,7 @@ func (config *Config) SetRoot(root string) *Config { return config } -// SetWatchmenConfig sets Planetmint's configuration +// SetPlanetmintConfig sets Planetmint's configuration func (config *Config) SetPlanetmintConfig(planetmintconfig interface{}) { jsonConfig, err := json.Marshal(planetmintconfig) if err != nil { diff --git a/prepare4linting.sh b/prepare4linting.sh deleted file mode 100755 index 85916dc..0000000 --- a/prepare4linting.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -export LINT="//lint:file-ignore SA1019 Ignore all deprecation errors, it's generated" - -# Add lint-ignore comment to beginning of files -sed -i "1i${LINT}" ./x/asset/types/query.pb.gw.go -sed -i "1i${LINT}" ./x/machine/types/query.pb.gw.go -sed -i "1i${LINT}" ./x/dao/types/query.pb.gw.go \ No newline at end of file diff --git a/staticcheck.conf b/staticcheck.conf new file mode 100644 index 0000000..1d69f06 --- /dev/null +++ b/staticcheck.conf @@ -0,0 +1 @@ +checks = ["all", "-SA1019", "-ST1000"] diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index d21770a..0592733 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -35,7 +35,7 @@ const Fees = "1stake" // DefaultDerivationPath is the BIP44Prefix for PLMNT (see https://github.com/satoshilabs/slips/blob/master/slip-0044.md) const DefaultDerivationPath = "m/44'/8680'/0'/0/0" -// ConstantBech32Addr for mocks +// ConstBech32Addr constant bech32 address for mocks const ConstBech32Addr = "plmnt10mq5nj8jhh27z7ejnz2ql3nh0qhzjnfvy50877" // KeyPair returns a sample private / public keypair @@ -63,6 +63,7 @@ func Secp256k1AccAddress() sdk.AccAddress { return sdk.AccAddress(addr) } +// Machine creates a new machine object // TODO: make address deterministic for test cases func Machine(name, pubKey string, prvKey string, address string) machinetypes.Machine { metadata := Metadata()