diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ef645f40..57926726 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,25 +33,7 @@ jobs: github-token: ${{ secrets.github_token }} # Check only if there are differences in the source code if: env.GIT_DIFF - markdown-lint: - name: Run markdown-lint - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6.1.2 - with: - PATTERNS: | - docs/**/*.md - x/**/*.md - README.md - - uses: nosborn/github-action-markdown-cli@v3.2.0 - with: - files: . - config_file: .markdownlint.yml - ignore_path: .markdownlintignore - # Check only if there are differences in the source code - if: env.GIT_DIFF + python-lint: name: Run flake8 on python integration tests runs-on: ubuntu-latest @@ -68,6 +50,7 @@ jobs: - run: | nix-shell -I nixpkgs=./nix -p test-env --run "make lint-py" if: env.GIT_DIFF + gomod2nix: name: Check gomod2nix.toml file is up to date runs-on: ubuntu-latest diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index f8df85b7..ec096761 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -3,7 +3,7 @@ package cli import ( "encoding/hex" "fmt" - "io/ioutil" + "os" "time" "github.com/cosmos/cosmos-sdk/client" @@ -134,7 +134,7 @@ func GetCmdCommitBid() *cobra.Command { } // Save reveal file. - err = ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0o600) + err = os.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0o600) if err != nil { return err } @@ -169,7 +169,7 @@ func GetCmdRevealBid() *cobra.Command { auctionID := args[0] revealFilePath := args[1] - revealBytes, err := ioutil.ReadFile(revealFilePath) // #nosec G304 + revealBytes, err := os.ReadFile(revealFilePath) // #nosec G304 if err != nil { return err } diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 794309e0..0f375972 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -58,7 +58,12 @@ type AuctionClientKeeper interface { } // NewKeeper creates new instances of the auction Keeper -func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ps params.Subspace) Keeper { +func NewKeeper(accountKeeper auth.AccountKeeper, + bankKeeper bank.Keeper, + storeKey storetypes.StoreKey, + cdc codec.BinaryCodec, + ps params.Subspace, +) Keeper { if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) } @@ -585,11 +590,9 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) { if secondHighestBid != nil { auction.WinningPrice = secondHighestBid.BidAmount } - ctx.Logger().Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddress)) ctx.Logger().Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBid.String())) ctx.Logger().Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String())) - } else { ctx.Logger().Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id)) } diff --git a/x/bond/keeper/grpc_query.go b/x/bond/keeper/grpc_query.go index 0742bc5a..40d56847 100644 --- a/x/bond/keeper/grpc_query.go +++ b/x/bond/keeper/grpc_query.go @@ -46,7 +46,9 @@ func (q Querier) GetBondsByOwner(c context.Context, req *types.QueryGetBondsByOw return &types.QueryGetBondsByOwnerResponse{Bonds: bonds}, nil } -func (q Querier) GetBondsModuleBalance(c context.Context, _ *types.QueryGetBondModuleBalanceRequest) (*types.QueryGetBondModuleBalanceResponse, error) { +func (q Querier) GetBondsModuleBalance(c context.Context, + _ *types.QueryGetBondModuleBalanceRequest, +) (*types.QueryGetBondModuleBalanceResponse, error) { ctx := sdk.UnwrapSDKContext(c) balance := q.Keeper.GetBondModuleBalances(ctx) return &types.QueryGetBondModuleBalanceResponse{Balance: balance}, nil diff --git a/x/bond/keeper/keeper.go b/x/bond/keeper/keeper.go index 9854e833..05b0567e 100644 --- a/x/bond/keeper/keeper.go +++ b/x/bond/keeper/keeper.go @@ -39,7 +39,13 @@ type Keeper struct { } // NewKeeper creates new instances of the bond Keeper -func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, usageKeepers []types.BondUsageKeeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace) Keeper { +func NewKeeper(cdc codec.BinaryCodec, + accountKeeper auth.AccountKeeper, + bankKeeper bank.Keeper, + usageKeepers []types.BondUsageKeeper, + storeKey storetypes.StoreKey, + ps paramtypes.Subspace, +) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index 22d55983..1d228136 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -2,7 +2,7 @@ package cli import ( "fmt" - "io/ioutil" + "os" "strings" "github.com/cerc-io/laconicd/server/flags" @@ -380,7 +380,7 @@ $ %s tx %s delete-name [crn] func GetPayloadFromFile(filePath string) (*types.PayloadType, error) { var payload types.PayloadType - data, err := ioutil.ReadFile(filePath) // #nosec G304 + data, err := os.ReadFile(filePath) // #nosec G304 if err != nil { return nil, err } diff --git a/x/registry/keeper/grpc_query.go b/x/registry/keeper/grpc_query.go index 3c13ceba..c5f04ec0 100644 --- a/x/registry/keeper/grpc_query.go +++ b/x/registry/keeper/grpc_query.go @@ -60,7 +60,9 @@ func (q Querier) GetRecordByBondID(c context.Context, req *types.QueryRecordByBo return &types.QueryRecordByBondIDResponse{Records: records}, nil } -func (q Querier) GetRegistryModuleBalance(c context.Context, _ *types.GetRegistryModuleBalanceRequest) (*types.GetRegistryModuleBalanceResponse, error) { +func (q Querier) GetRegistryModuleBalance(c context.Context, + _ *types.GetRegistryModuleBalanceRequest, +) (*types.GetRegistryModuleBalanceResponse, error) { ctx := sdk.UnwrapSDKContext(c) balances := q.Keeper.GetModuleBalances(ctx) return &types.GetRegistryModuleBalanceResponse{ @@ -109,7 +111,9 @@ func (q Querier) GetRecordExpiryQueue(c context.Context, _ *types.QueryGetRecord return &types.QueryGetRecordExpiryQueueResponse{Records: records}, nil } -func (q Querier) GetAuthorityExpiryQueue(c context.Context, _ *types.QueryGetAuthorityExpiryQueue) (*types.QueryGetAuthorityExpiryQueueResponse, error) { +func (q Querier) GetAuthorityExpiryQueue(c context.Context, + _ *types.QueryGetAuthorityExpiryQueue, +) (*types.QueryGetAuthorityExpiryQueueResponse, error) { ctx := sdk.UnwrapSDKContext(c) authorities := q.Keeper.GetAuthorityExpiryQueue(ctx) return &types.QueryGetAuthorityExpiryQueueResponse{Authorities: authorities}, nil