Skip to content

Commit 98b554b

Browse files
authored
Merge pull request #181 from influxdata/crepererum/spellcheck
chore: catch typos
2 parents 6f09233 + d0f6509 commit 98b554b

File tree

10 files changed

+37
-19
lines changed

10 files changed

+37
-19
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ jobs:
5151
- name: Install `yamllint`
5252
run: pip install --requirement=.github/workflows/requirements.txt
5353

54-
- name: Install `cargo-deny` & `just`
54+
- name: Install `cargo-deny` & `just` & 'typos'
5555
uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2
5656
with:
57-
tool: cargo-deny,just
57+
tool: cargo-deny,just,typos
5858

5959
- name: Install `tombi`
6060
uses: tombi-toml/setup-tombi@a9378ac9fe5c29df7d26263deacea4ac642af9c2 # v1

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Install [Python] to set up the environment for the [Python] guest.
2828
### Tombi
2929
Install [tombi] to format and lint [TOML] files.
3030

31+
### Spellcheck
32+
Install [typos] to run an automatic spellcheck.
33+
3134

3235
## Checks
3336
There is one "run everything" [just] recipe:
@@ -112,4 +115,5 @@ Then the [Python Standard Library] was not found or not bundled correctly. You m
112115
[rustup]: https://rustup.rs/
113116
[tombi]: https://tombi-toml.github.io/tombi
114117
[TOML]: https://toml.io/
118+
[typos]: https://github.com/crate-ci/typos
115119
[yamllint]: https://github.com/adrienverge/yamllint

Justfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ check-rust-deny:
5252
# run ALL Rust checks
5353
check-rust: check-rust-fmt check-rust-check check-rust-build check-rust-clippy check-rust-test check-rust-doc check-rust-bench check-rust-deny
5454

55+
# check spelling
56+
check-spelling:
57+
@echo ::group::check-spelling
58+
typos
59+
@echo ::endgroup::
60+
5561
# check TOML formatting
5662
check-toml-fmt:
5763
@echo ::group::check-toml-fmt
@@ -74,7 +80,7 @@ check-yaml:
7480
@echo ::endgroup::
7581

7682
# run ALL checks
77-
check: check-rust check-toml check-yaml
83+
check: check-rust check-spelling check-toml check-yaml
7884

7985
# clean Rust build artifacts
8086
clean-rust:
@@ -106,6 +112,12 @@ fix-rust-fmt:
106112
# fix common Rust issues automatically
107113
fix-rust: fix-rust-clippy fix-rust-check fix-rust-fmt
108114

115+
# fix typos
116+
fix-spellcheck:
117+
@echo ::group::fix-rust-fmt
118+
typos --write-changes
119+
@echo ::endgroup::
120+
109121
# fix TOML formatting
110122
fix-toml-fmt:
111123
@echo ::group::fix-toml-fmt
@@ -116,4 +128,4 @@ fix-toml-fmt:
116128
fix-toml: fix-toml-fmt
117129

118130
# fix common issues automatically
119-
fix: fix-rust fix-toml
131+
fix: fix-spellcheck fix-rust fix-toml

guests/evil/src/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Payload that interact with the (virtual) file sytem.
1+
//! Payload that interact with the (virtual) file system.
22
use std::{hash::Hash, sync::Arc};
33

44
use arrow::{array::StringArray, datatypes::DataType};

guests/python/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(crate) trait PyErrExt {
5858
/// try:
5959
/// my_fn(...)
6060
/// except Exception as e:
61-
/// raise Excpetion("foo") from e
61+
/// raise Exception("foo") from e
6262
/// ```
6363
///
6464
///

guests/python/src/inspect.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'a, 'py> FromPyObject<'a, 'py> for PythonType {
3131
// https://docs.python.org/3/library/datetime.html
3232
let mod_datetime = py.import(intern!(py, "datetime"))?;
3333
let type_date = mod_datetime.getattr(intern!(py, "date"))?;
34-
let type_dateime = mod_datetime.getattr(intern!(py, "datetime"))?;
34+
let type_datetime = mod_datetime.getattr(intern!(py, "datetime"))?;
3535
let type_time = mod_datetime.getattr(intern!(py, "time"))?;
3636
let type_timedelta = mod_datetime.getattr(intern!(py, "timedelta"))?;
3737

@@ -45,7 +45,7 @@ impl<'a, 'py> FromPyObject<'a, 'py> for PythonType {
4545
Ok(Self::Bytes)
4646
} else if ob.is(type_date) {
4747
Ok(Self::Date)
48-
} else if ob.is(type_dateime) {
48+
} else if ob.is(type_datetime) {
4949
Ok(Self::DateTime)
5050
} else if ob.is(type_float) {
5151
Ok(Self::Float)
@@ -107,7 +107,7 @@ impl<'a, 'py> FromPyObject<'a, 'py> for PythonNullableType {
107107

108108
if args.len() != 1 {
109109
return Err(PyErr::new::<PyTypeError, _>(format!(
110-
"only unions of form `T | None` are suppored, but got a union of {} distinct none-NULL types",
110+
"only unions of form `T | None` are supported, but got a union of {} distinct none-NULL types",
111111
args.len()
112112
)));
113113
}
@@ -156,7 +156,7 @@ impl<'a, 'py> FromPyObject<'a, 'py> for PythonFnSignature {
156156
let kind_name = kind_name.to_str()?;
157157
if (kind_name != "POSITIONAL_OR_KEYWORD") && (kind_name != "POSITIONAL_ONLY") {
158158
return Err(PyErr::new::<PyTypeError, _>(
159-
format!("only paramters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got {kind_name}")
159+
format!("only parameters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got {kind_name}")
160160
));
161161
}
162162

guests/python/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn root() -> Option<Vec<u8>> {
272272
/// and will result in a "no-op"
273273
///
274274
/// # Panic
275-
/// This assumes that the root file system contains the [Python Standard Library] or that the Python interpeter can
275+
/// This assumes that the root file system contains the [Python Standard Library] or that the Python interpreter can
276276
/// find it somewhere else (e.g. when executed outside of a WASM context).
277277
///
278278
/// Otherwise this will likely panic and you find the following printed to stderr:

host/tests/integration_tests/python/argument_forms.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def foo(*x: int) -> int:
194194
@r"
195195
scalar_udfs
196196
caused by
197-
Error during planning: TypeError: only paramters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got VAR_POSITIONAL
197+
Error during planning: TypeError: only parameters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got VAR_POSITIONAL
198198
199199
The above exception was the direct cause of the following exception:
200200
@@ -216,7 +216,7 @@ def foo(*, x: int) -> int:
216216
@r"
217217
scalar_udfs
218218
caused by
219-
Error during planning: TypeError: only paramters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got KEYWORD_ONLY
219+
Error during planning: TypeError: only parameters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got KEYWORD_ONLY
220220
221221
The above exception was the direct cause of the following exception:
222222
@@ -238,7 +238,7 @@ def foo(**x: int) -> int:
238238
@r"
239239
scalar_udfs
240240
caused by
241-
Error during planning: TypeError: only paramters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got VAR_KEYWORD
241+
Error during planning: TypeError: only parameters of kind `POSITIONAL_OR_KEYWORD` and `POSITIONAL_ONLY` are supported, got VAR_KEYWORD
242242
243243
The above exception was the direct cause of the following exception:
244244

host/tests/integration_tests/python/inspection/errors.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def add_one(x: int | str) -> int:
8080
@r"
8181
scalar_udfs
8282
caused by
83-
Error during planning: TypeError: only unions of form `T | None` are suppored, but got a union of 2 distinct none-NULL types
83+
Error during planning: TypeError: only unions of form `T | None` are supported, but got a union of 2 distinct none-NULL types
8484
8585
The above exception was the direct cause of the following exception:
8686
@@ -105,7 +105,7 @@ def add_one(x: int | str | None) -> int:
105105
@r"
106106
scalar_udfs
107107
caused by
108-
Error during planning: TypeError: only unions of form `T | None` are suppored, but got a union of 2 distinct none-NULL types
108+
Error during planning: TypeError: only unions of form `T | None` are supported, but got a union of 2 distinct none-NULL types
109109
110110
The above exception was the direct cause of the following exception:
111111
@@ -130,7 +130,7 @@ def add_one(x: int | str | int) -> int:
130130
@r"
131131
scalar_udfs
132132
caused by
133-
Error during planning: TypeError: only unions of form `T | None` are suppored, but got a union of 2 distinct none-NULL types
133+
Error during planning: TypeError: only unions of form `T | None` are supported, but got a union of 2 distinct none-NULL types
134134
135135
The above exception was the direct cause of the following exception:
136136
@@ -155,7 +155,7 @@ def add_one(x: int | None | str | int) -> int:
155155
@r"
156156
scalar_udfs
157157
caused by
158-
Error during planning: TypeError: only unions of form `T | None` are suppored, but got a union of 2 distinct none-NULL types
158+
Error during planning: TypeError: only unions of form `T | None` are supported, but got a union of 2 distinct none-NULL types
159159
160160
The above exception was the direct cause of the following exception:
161161
@@ -180,7 +180,7 @@ def add_one(x: int | str | float) -> int:
180180
@r"
181181
scalar_udfs
182182
caused by
183-
Error during planning: TypeError: only unions of form `T | None` are suppored, but got a union of 3 distinct none-NULL types
183+
Error during planning: TypeError: only unions of form `T | None` are supported, but got a union of 3 distinct none-NULL types
184184
185185
The above exception was the direct cause of the following exception:
186186

typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default]
2+
locale = "en-us"

0 commit comments

Comments
 (0)