Skip to content

Commit f849192

Browse files
authored
Merge pull request #581 from CosmWasm/co/add-typo-check
Add typo check
2 parents bb5b8c1 + bdbeadc commit f849192

18 files changed

+45
-24
lines changed

.github/workflows/typo-check.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Check for typos
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
check-typos:
13+
name: "Spell-check repository source"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Run spell-check
19+
uses: crate-ci/typos@master

_typos.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default]
2+
extend-ignore-re = ["(?Rm)^.*(#|//)\\s*spellchecker:disable-line$"]

builders/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ See those DockerHub repos for all available versions of the builder images.
149149

150150
## Usage
151151

152-
Create the Docker images, capable of cross-compling Linux and MacOS dynamic
152+
Create the Docker images, capable of cross-compiling Linux and MacOS dynamic
153153
libs. As the builder images are all x86_64, it can be slow and memory intense to
154154
do this on a different architecture:
155155

docs/COMPILER_VERSIONS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ supported by cosmwasm-std/cosmwasm-vm.
5454

5555
## Tooling Rust compiler
5656

57-
This Rust version is not related to our codebase directy. It's sufficiently
57+
This Rust version is not related to our codebase directly. It's sufficiently
5858
modern to install and execute tools like `cargo-audit`.
5959

6060
## Versions in use

docs/MIGRATING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ where the old name was deprecated.
6464
| `SubcallResponse` | `SubMsgResponse` | Contracts do not "call" each other but send messages around |
6565
| `HumanizeAddress` | `HumanizeAddressFunc` | Follow [best practice for naming function types][ft] |
6666
| `CanonicalizeAddress` | `CanonicalizeAddressFunc` | Follow [best practice for naming function types][ft] |
67-
| `GoAPI.HumanAddress` | `GoAPI.HumanizeAddress` | Perfer verbs for converters |
68-
| `GoAPI.CanonicalAddress` | `GoAPI.CanonicalizeAddress` | Perfer verbs for converters |
67+
| `GoAPI.HumanAddress` | `GoAPI.HumanizeAddress` | Prefer verbs for converters |
68+
| `GoAPI.CanonicalAddress` | `GoAPI.CanonicalizeAddress` | Prefer verbs for converters |
6969
| `CosmosMsg.Stargate` | `CosmosMsg.Any` | The message has nothing to do with Stargate |
7070
| `StargateMsg` | `AnyMsg` | The message has nothing to do with Stargate |
7171
| `QueryResponse` | `QueryResult` | Brings consistency with the naming of the other results |

internal/api/bindings.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ typedef struct ByteSliceView {
163163
* ```
164164
*
165165
*
166-
* If you want to mutate data, you need to comsume the vector and create a new one:
166+
* If you want to mutate data, you need to consume the vector and create a new one:
167167
*
168168
* ```rust
169169
* # use wasmvm::{UnmanagedVector};
@@ -308,7 +308,7 @@ typedef struct GoIter {
308308
struct gas_meter_t *gas_meter;
309309
/**
310310
* A reference which identifies the iterator and allows finding and accessing the
311-
* actual iterator instance in Go. Once fully initalized, this is immutable.
311+
* actual iterator instance in Go. Once fully initialized, this is immutable.
312312
*/
313313
struct IteratorReference reference;
314314
struct IteratorVtable vtable;

internal/api/memory_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestCreateAndDestroyUnmanagedVector(t *testing.T) {
5050
var original []byte
5151
unmanaged := newUnmanagedVector(original)
5252
require.Equal(t, cbool(true), unmanaged.is_none)
53-
// We must not make assumtions on the other fields in this case
53+
// We must not make assumptions on the other fields in this case
5454
copy := copyAndDestroyUnmanagedVector(unmanaged)
5555
require.Nil(t, copy)
5656
}

internal/api/mocks.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func (l *Lookup) WithGasMeter(meter MockGasMeter) *Lookup {
277277
}
278278
}
279279

280-
// Get wraps the underlying DB's Get method panicing on error.
280+
// Get wraps the underlying DB's Get method panicking on error.
281281
func (l Lookup) Get(key []byte) []byte {
282282
l.meter.ConsumeGas(GetPrice, "get")
283283
v, err := l.db.Get(key)
@@ -288,23 +288,23 @@ func (l Lookup) Get(key []byte) []byte {
288288
return v
289289
}
290290

291-
// Set wraps the underlying DB's Set method panicing on error.
291+
// Set wraps the underlying DB's Set method panicking on error.
292292
func (l Lookup) Set(key, value []byte) {
293293
l.meter.ConsumeGas(SetPrice, "set")
294294
if err := l.db.Set(key, value); err != nil {
295295
panic(err)
296296
}
297297
}
298298

299-
// Delete wraps the underlying DB's Delete method panicing on error.
299+
// Delete wraps the underlying DB's Delete method panicking on error.
300300
func (l Lookup) Delete(key []byte) {
301301
l.meter.ConsumeGas(RemovePrice, "remove")
302302
if err := l.db.Delete(key); err != nil {
303303
panic(err)
304304
}
305305
}
306306

307-
// Iterator wraps the underlying DB's Iterator method panicing on error.
307+
// Iterator wraps the underlying DB's Iterator method panicking on error.
308308
func (l Lookup) Iterator(start, end []byte) types.Iterator {
309309
l.meter.ConsumeGas(RangePrice, "range")
310310
iter, err := l.db.Iterator(start, end)
@@ -315,7 +315,7 @@ func (l Lookup) Iterator(start, end []byte) types.Iterator {
315315
return iter
316316
}
317317

318-
// ReverseIterator wraps the underlying DB's ReverseIterator method panicing on error.
318+
// ReverseIterator wraps the underlying DB's ReverseIterator method panicking on error.
319319
func (l Lookup) ReverseIterator(start, end []byte) types.Iterator {
320320
l.meter.ConsumeGas(RangePrice, "range")
321321
iter, err := l.db.ReverseIterator(start, end)

lib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func LibwasmvmVersion() (string, error) {
4040

4141
// CreateChecksum performs the hashing of Wasm bytes to obtain the CosmWasm checksum.
4242
//
43-
// Ony Wasm blobs are allowed as inputs and a magic byte check will be performed
43+
// Only Wasm blobs are allowed as inputs and a magic byte check will be performed
4444
// to avoid accidental misusage.
4545
func CreateChecksum(wasm []byte) (Checksum, error) {
4646
if len(wasm) == 0 {

libwasmvm/bindings.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ typedef struct ByteSliceView {
163163
* ```
164164
*
165165
*
166-
* If you want to mutate data, you need to comsume the vector and create a new one:
166+
* If you want to mutate data, you need to consume the vector and create a new one:
167167
*
168168
* ```rust
169169
* # use wasmvm::{UnmanagedVector};
@@ -308,7 +308,7 @@ typedef struct GoIter {
308308
struct gas_meter_t *gas_meter;
309309
/**
310310
* A reference which identifies the iterator and allows finding and accessing the
311-
* actual iterator instance in Go. Once fully initalized, this is immutable.
311+
* actual iterator instance in Go. Once fully initialized, this is immutable.
312312
*/
313313
struct IteratorReference reference;
314314
struct IteratorVtable vtable;
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This is an entry point into the library in order to set
2-
// crate-type = ["staticlib"] via a command line arument.
2+
// crate-type = ["staticlib"] via a command line argument.
33
// See `--example wasmvmstatic`
44

55
pub use wasmvm::*;

libwasmvm/src/iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Vtable for IteratorVtable {}
5858
pub struct GoIter {
5959
pub gas_meter: *mut gas_meter_t,
6060
/// A reference which identifies the iterator and allows finding and accessing the
61-
/// actual iterator instance in Go. Once fully initalized, this is immutable.
61+
/// actual iterator instance in Go. Once fully initialized, this is immutable.
6262
pub reference: IteratorReference,
6363
pub vtable: IteratorVtable,
6464
}

libwasmvm/src/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl U8SliceView {
180180
/// ```
181181
///
182182
///
183-
/// If you want to mutate data, you need to comsume the vector and create a new one:
183+
/// If you want to mutate data, you need to consume the vector and create a new one:
184184
///
185185
/// ```rust
186186
/// # use wasmvm::{UnmanagedVector};

libwasmvm/src/vtables.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// In fact, in Go we create a single global vtable variable holding and owning the
77
/// function the vtables in Rust point to.
88
///
9-
/// The `Vtable` trait is created to find those vtables troughout the codebase.
9+
/// The `Vtable` trait is created to find those vtables throughout the codebase.
1010
///
1111
/// ## Nullability
1212
///

types/env.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package types
44

55
// Env defines the state of the blockchain environment this contract is
66
// running in. This must contain only trusted data - nothing from the Tx itself
7-
// that has not been verfied (like Signer).
7+
// that has not been verified (like Signer).
88
//
99
// Env are json encoded to a byte slice before passing to the wasm contract.
1010
type Env struct {

types/ibc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const (
206206
// Ordering is (revision_number, timeout_height)
207207
type IBCTimeoutBlock struct {
208208
// the version that the client is currently on
209-
// (eg. after reseting the chain this could increment 1 as height drops to 0)
209+
// (eg. after resetting the chain this could increment 1 as height drops to 0)
210210
Revision uint64 `json:"revision"`
211211
// block height after which the packet times out.
212212
// the height within the given revision

types/queries.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type queryResultImpl struct {
1818
// A custom serializer that allows us to map QueryResult instances to the Rust
1919
// enum `ContractResult<Binary>`
2020
func (q QueryResult) MarshalJSON() ([]byte, error) {
21-
// In case both Ok and Err are empty, this is interpreted and seralized
21+
// In case both Ok and Err are empty, this is interpreted and serialized
2222
// as an Ok case with no data because errors must not be empty.
2323
if len(q.Ok) == 0 && len(q.Err) == 0 {
2424
return []byte(`{"ok":""}`), nil

types/types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ type DenomUnit struct {
115115
// Modeled after the Cosmos SDK's [DecCoin] type.
116116
// However, in contrast to the Cosmos SDK the `amount` string MUST always have a dot at JSON level,
117117
// see <https://github.com/cosmos/cosmos-sdk/issues/10863>.
118-
// Also if Cosmos SDK choses to migrate away from fixed point decimals
118+
// Also if Cosmos SDK chooses to migrate away from fixed point decimals
119119
// (as shown [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/x/group/internal/math/dec.go#L13-L21) and discussed [here](https://github.com/cosmos/cosmos-sdk/issues/11783)),
120120
// wasmd needs to truncate the decimal places to 18.
121121
//
@@ -210,7 +210,7 @@ func (pm *PinnedMetrics) UnmarshalMessagePack(data []byte) error {
210210
}
211211

212212
// Array is a wrapper around a slice that ensures that we get "[]" JSON for nil values.
213-
// When unmarshaling, we get an empty slice for "[]" and "null".
213+
// When unmarshalling, we get an empty slice for "[]" and "null".
214214
//
215215
// This is needed for fields that are "Vec<C>" on the Rust side because `null` values
216216
// will result in an error there.

0 commit comments

Comments
 (0)