Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: link lint + spell check #179

Merged
merged 7 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,*.sum,*.mod,*_test.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i notice that here we skip Go test files but your PR in the relayer didn't, is this on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, many test files use things like userA, step, and other words which are commonly flagged as incorrectly spelled. With the different cases it messes with codespell and is kind of a pain. so just ignoring for now

ignore-words-list = userA,users,create,crate
count =
quiet-level = 3
10 changes: 5 additions & 5 deletions .github/workflows/ibc-hooks.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: ibc-hooks
on:
on:
pull_request:
paths:
- 'modules/ibc-hooks/**'
- '.github/workflows/ibc-hooks.yml'

env:
LINT_VERSION: v1.52
LINT_VERSION: v1.55.2
GO_VERSION: 1.21.0
WORKING_DIRECTORY: modules/ibc-hooks

jobs:
golangci:
name: Linter
runs-on: ubuntu-latest
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -37,4 +37,4 @@ jobs:

- name: Test
run: go test ./...
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ env.WORKING_DIRECTORY }}
9 changes: 9 additions & 0 deletions .github/workflows/markdown-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Check Markdown links
on:
pull_request:
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/[email protected]
17 changes: 17 additions & 0 deletions .github/workflows/mispell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: typos

on:
pull_request:

jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run codespell
continue-on-error: true
run: |
# .codespellrc is used
sudo apt-get install codespell -y
codespell -w --config .codespellrc
exit $?
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ For features, every module should have [interchain-test](https://github.com/stra
For modules, ensure full test coverage and compatibility with the main branch.


## New contributer approval process
## New contributor approval process
- [ ] Submit a Github issue titled "I should be a maintainer because..."
- [ ] After approval, write privileges will be granted to a member of an external team.
- [ ] Merging PRs will require approval from more than one team

Privileges will be revoked in case of failure to comply with the [Code of Conduct](../CODE_OF_CONDUCT.md)
Privileges will be revoked in case of failure to comply with the [Code of Conduct](./CODE_OF_CONDUCT.md)


## Versioning
Expand Down
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ IBC applications and middleware for Cosmos SDK blockchains
🌌 Why have an ibc-apps repo?
================================

Early IBC work started in the [ibc-go](https://github.com/cosmos/ibc-go) repo. As the repo grew, the need arose to parallelize the work among many teams.
Early IBC work started in the [ibc-go](https://github.com/cosmos/ibc-go) repo. As the repo grew, the need arose to parallelize the work among many teams.

The ibc-apps repo is meant to be an easily discoverable, navigable, central place for modules and middleware.

🌌🌌 Who's it for?
===================

IBC-Apps is for:
IBC-Apps is for:
- _Core **ibc-go** contributors_; it frees them from having to maintain IBC Apps,

- _Publishers of **ibc apps**_, so their apps can be easily found, and
- _Publishers of **ibc apps**_, so their apps can be easily found, and

- _Everyone who uses IBC_ and wants to benefit from the full range of its capabilities.

Expand All @@ -40,7 +40,7 @@ IBC apps can be split into two categories - modules and middleware.

IBC Modules are self-contained applications that enable packets to be sent to and received from other IBC-enabled chains. IBC application developers do not need to concern themselves with the low-level details of clients, connections, and proof verification.

IBC Middleware are self-contained modules that sit between core IBC and an underlying IBC application. This allows developers to customize lower-level packet handling. Multiple middleware modules can be chained together.
IBC Middleware are self-contained modules that sit between core IBC and an underlying IBC application. This allows developers to customize lower-level packet handling. Multiple middleware modules can be chained together.


🌌🌌🌌🌌 How to Use this repo
Expand All @@ -51,10 +51,6 @@ If you'd like to include software in this repo, please see [contributing](../ibc
🌌🌌🌌🌌🌌 Bonus Content
=============================

## Hello World

An [example IBC app](./examples/hello-world/)

## Maintained Branches

| **Branch Name** | **IBC-Go** |
Expand All @@ -68,7 +64,7 @@ An [example IBC app](./examples/hello-world/)
## List of Apps

| Name | Type | Example | Stakeholders | Description |
| ---- | ---- | ------- | ------------ | ----------- |
| ---- | ---- | ------- | ------------ | ----------- |
| [Async Interchain Query](./modules/async-icq/) | Module | Link | [Strangelove](https://github.com/strangelove-ventures/) | Interchain Queries enable blockchains to query the state of an account on another chain without the need for ICA auth. |
| [IBC Hooks](./modules/ibc-hooks/) | Module | [Link](./modules/ibc-hooks/simapp/app.go) | [Osmosis](https://github.com/osmosis-labs) | The IBC hooks module is an IBC middleware that enables ICS-20 token transfers to initiate contract calls. |
| [Packet Forward Middleware](./middleware/packet-forward-middleware) | Middleware | Link | [Strangelove](https://github.com/strangelove-ventures/) | Middleware for forwarding IBC packets. |
Expand All @@ -78,12 +74,13 @@ An [example IBC app](./examples/hello-world/)
Modules and middleware developed by other awesome teams in the ecosystem:

| Name | Type | Stakeholders | Description |
| ---- | ---- | ------------ | ----------- |
| ---- | ---- | ------------ | ----------- |
| [Interchain KV Queries](https://github.com/ingenuity-build/interchain-queries) | Module | [Ingenuity](https://github.com/ingenuity-build) | An application that enables on chain querying of another IBC enabled chains state without the need for the chain being queried to implement the application. |
| [query](https://github.com/defund-labs/defund/tree/main/x/query) | Module | [Defund Labs](https://github.com/defund-labs) | An application that enables on chain querying of another IBC enabled chains state without the need for the chain being queried to implement the application. Similar to the interchain-queries application in the row above but without callbacks. |
| [NFT Transfer (ICS 721)](https://github.com/bianjieai/nft-transfer) | Module | [Bianjieai](https://github.com/bianjieai) | An application that enables cross chain NFT transfer. |
| [CosmWasm NFT Transfer (ICS 721)](https://github.com/public-awesome/cw-ics721) | WASM Contract | [Public Awesome (Stargaze)](https://github.com/public-awesome), [Ark Protocol](https://twitter.com/ArkProtocol) | An application that enables cross chain NFT transfer. CosmWasm implementation of the above, written in Rust. |
| [recovery](https://github.com/evmos/evmos/tree/main/x/recovery) | Middleware | [Evmos](https://github.com/evmos) | Middleware enabling the recovery of tokens sent to unsupported addresses. |
<!-- markdown-link-check-disable-next-line -->
Reecepbcups marked this conversation as resolved.
Show resolved Hide resolved
| [CosmWasm NFT Transfer (ICS 721)](https://github.com/public-awesome/cw-ics721) | WASM Contract | [Public Awesome (Stargaze)](https://github.com/public-awesome), [Ark Protocol](https://x.com/ArkProtocol) | An application that enables cross chain NFT transfer. CosmWasm implementation of the above, written in Rust. |
| [recovery](https://github.com/evmos/evmos/tree/v15.0.0/x/recovery) | Middleware | [Evmos](https://github.com/evmos) | Middleware enabling the recovery of tokens sent to unsupported addresses. |
| [ibc-rate-limit](https://github.com/osmosis-labs/osmosis/tree/main/x/ibc-rate-limit) | Middleware | [Osmosis Labs](https://github.com/osmosis-labs) | Middleware that limits the in or out flow of an asset in a certain time period to minimise the risks of cross chain token transfers. This is implemented as a middleware wrapping ICS20 with the rate limiting logic implemented by cosmwasm contracts. |
| [Interchain Atomic Swap](https://github.com/sideprotocol/ibcswap-wasm/tree/main/contracts/ics100) | WASM Contract | [Side Labs](https://github.com/sideprotocol) | An application that facilitates inter-blockchain peer-to-peer asset swaps. |
| [Interchain Atomic Swap](https://github.com/sideprotocol/mesh-liquidity-wasm/tree/v0.1.0/contracts/ics100) | WASM Contract | [Side Labs](https://github.com/sideprotocol) | An application that facilitates inter-blockchain peer-to-peer asset swaps. |
| [Interchain Liquidity](https://github.com/sideprotocol/ibcswap-wasm/tree/main/contracts/ics101) | WASM Contract | [Side Labs](https://github.com/sideprotocol) | An application that splits the state of a weighted liquidity pool between two chains, enabling inter-blockchain automated asset swaps. |
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (k *Keeper) WriteAcknowledgementForForwardedPacket(
ctx, transfertypes.ModuleName, newToken,
); err != nil {
// NOTE: should not happen as the module account was
// retrieved on the step above and it has enough balace
// retrieved on the step above and it has enough balance
// to burn.
panic(fmt.Sprintf("cannot burn coins after a successful send from escrow account to module account: %v", err))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type EncodingConfig struct {

// MakeTestEncodingConfig creates an EncodingConfig for a non-amino based test configuration.
// This function should be used only internally (in the SDK).
// App user should'nt create new codecs - use the app.AppCodec instead.
// App user shouldn't create new codecs - use the app.AppCodec instead.
// [DEPRECATED]
func MakeTestEncodingConfig() EncodingConfig {
cdc := codec.NewLegacyAmino()
Expand Down
2 changes: 1 addition & 1 deletion modules/async-icq/keeper/cache_ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// This function lets you run the function f, but if theres an error or panic
// This function lets you run the function f, but if there's an error or panic
// drop the state machine change and log the error.
// If there is no error, proceeds as normal (but with some slowdown due to SDK store weirdness)
// Try to avoid usage of iterators in f.
Expand Down
4 changes: 2 additions & 2 deletions modules/async-icq/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(types.DefaultGenesis())
}

// ValidateGenesis performs genesis state validation for the IBC interchain acounts module
// ValidateGenesis performs genesis state validation for the IBC interchain accounts module
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var gs types.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
Expand Down Expand Up @@ -103,7 +103,7 @@ func NewAppModule(keeper keeper.Keeper, ss exported.Subspace) AppModule {
}
}

// InitModule will initialize the interchain query moudule. It should only be
// InitModule will initialize the interchain query module. It should only be
// called once and as an alternative to InitGenesis.
func (am AppModule) InitModule(ctx sdk.Context, params types.Params) {
if err := am.keeper.SetParams(ctx, params); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (k msgServer) SendQueryAllBalances(goCtx context.Context, msg *types.MsgSen
},
}

// timeoutTimestamp set to max value with the unsigned bit shifted to sastisfy hermes timestamp conversion
// timeoutTimestamp set to max value with the unsigned bit shifted to satisfy hermes timestamp conversion
// it is the responsibility of the auth module developer to ensure an appropriate timeout timestamp
timeoutTimestamp := ctx.BlockTime().Add(time.Minute).UnixNano()
seq, err := k.SendQuery(ctx, types.PortID, msg.ChannelId, chanCap, reqs, clienttypes.ZeroHeight(), uint64(timeoutTimestamp))
Expand Down
2 changes: 1 addition & 1 deletion modules/ibc-hooks/wasm_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (h WasmHooks) OnRecvPacketOverride(im IBCMiddleware, ctx sdk.Context, packe

amount, ok := sdk.NewIntFromString(data.GetAmount())
if !ok {
// This should never happen, as it should've been caught in the underlaying call to OnRecvPacket,
// This should never happen, as it should've been caught in the underlying call to OnRecvPacket,
// but returning here for completeness
return NewEmitErrorAcknowledgement(ctx, types.ErrInvalidPacket, "Amount is not an int")
}
Expand Down
Loading