Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Commit 1601f00

Browse files
Merge pull request #645 from flavio/enable-crate-typos
test: check typos
2 parents 1669d4c + 10d7e86 commit 1601f00

File tree

9 files changed

+32
-8
lines changed

9 files changed

+32
-8
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ jobs:
8484
with:
8585
command: clippy
8686
args: --workspace -- -D warnings
87+
88+
spelling:
89+
name: Spell Check with Typos
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout Actions Repository
93+
uses: actions/checkout@v4
94+
- name: Spell Check Repo
95+
uses: crate-ci/typos@db35ee91e80fbb447f33b0e5fbddb24d2a1a884f # v1.29.10
96+
8797
coverage:
8898
name: coverage
8999
runs-on: ubuntu-latest

.typos.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[default]
2+
extend-ignore-re = [
3+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
4+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
5+
]
6+
7+
[files]
8+
extend-exclude = ["*.md", "*.toml"]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ lint:
1616
check:
1717
K8S_OPENAPI_ENABLED_VERSION=$(KUBE_API_VERSION) cargo check
1818

19+
.PHONY: typos
20+
typos:
21+
typos # run typo checker from crate-ci/typos
22+
1923
.PHONY: test
2024
test: fmt lint
2125
cargo test --workspace

crates/burrego/src/stack_helper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ impl StackHelper {
3030
let opa_json_dump_fn = instance
3131
.get_typed_func::<i32, i32>(store.as_context_mut(), "opa_json_dump")
3232
.map_err(|e| {
33-
BurregoError::RegoWasmError(format!("cannot access opa_json_dump fuction: {e:?}"))
33+
BurregoError::RegoWasmError(format!("cannot access opa_json_dump function: {e:?}"))
3434
})?;
3535
let opa_malloc_fn = instance
3636
.get_typed_func::<i32, i32>(store.as_context_mut(), "opa_malloc")
3737
.map_err(|e| {
38-
BurregoError::RegoWasmError(format!("Cannot access opa_malloc fuction: {e:?}"))
38+
BurregoError::RegoWasmError(format!("Cannot access opa_malloc function: {e:?}"))
3939
})?;
4040
let opa_json_parse_fn = instance
4141
.get_typed_func::<(i32, i32), i32>(store.as_context_mut(), "opa_json_parse")
4242
.map_err(|e| {
43-
BurregoError::RegoWasmError(format!("Cannot access opa_json_parse fuction: {e:?}"))
43+
BurregoError::RegoWasmError(format!("Cannot access opa_json_parse function: {e:?}"))
4444
})?;
4545

4646
let builtins_fn = instance

src/callback_handler/crypto.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ mod tests {
151151
};
152152
use kubewarden_policy_sdk::host_capabilities::crypto_v1::CertificateVerificationRequest;
153153

154+
// spellchecker:off
154155
const ROOT_CA1_PEM: &str = "-----BEGIN CERTIFICATE-----
155156
MIICSTCCAfCgAwIBAgIUQS1sQWI6HCOK5vsO2DDHqWZER7swCgYIKoZIzj0EAwIw
156157
gYIxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdCYXZhcmlhMRIwEAYDVQQHEwlOdXJl
@@ -236,6 +237,7 @@ EHuCFAQE5thiOSoEqilZAzAfBgNVHSMEGDAWgBR1uDPhKH7EjlGO2axbPKlTgy8j
236237
iDAKBggqhkjOPQQDAgNIADBFAiEArSsdE5dDXqAU2vM3ThT8GvTnjkWhER3l9v1j
237238
3ka2eiMCIBIMXVLY+XGEHNdarxDj8XKQurNf6Nngs0nU+5ggyF4F
238239
-----END CERTIFICATE-----";
240+
// spellchecker:on
239241

240242
#[test]
241243
fn certificate_is_trusted() {

src/policy_evaluator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl TryFrom<PolicyExecutionMode> for RegoPolicyExecutionMode {
6969
PolicyExecutionMode::Opa => Ok(RegoPolicyExecutionMode::Opa),
7070
PolicyExecutionMode::OpaGatekeeper => Ok(RegoPolicyExecutionMode::Gatekeeper),
7171
PolicyExecutionMode::KubewardenWapc | PolicyExecutionMode::Wasi => Err(anyhow!(
72-
"execution mode not convertible to a Rego based executon mode"
72+
"execution mode not convertible to a Rego based execution mode"
7373
)),
7474
}
7575
}

src/runtimes/rego/stack_pre.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use crate::runtimes::rego::errors::{RegoRuntimeError, Result};
99
/// to reduce the instantiation times. That happens because all
1010
/// Rego WebAssembly policies import their Wasm Memory from the host.
1111
/// The Wasm Memory is defined inside of a `wasmtime::Store`, which is
12-
/// something that `wasmtime::InstnacePre` objects do not have (rightfully!).
12+
/// something that `wasmtime::InstancePre` objects do not have (rightfully!).
1313
///
14-
/// However, Rego Wasm modules are so small thta instantiating them from scratch
14+
/// However, Rego Wasm modules are so small that instantiating them from scratch
1515
/// is already a cheap operation.
1616
#[derive(Clone)]
1717
pub(crate) struct StackPre {

tests/data/endless_wasm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This is a module meant to be used by a waPC host.
2121

2222
This code cheats a little, from the outside it looks like any regular waPC module
2323
because it exposes the two functions required by a waPC host. However, these
24-
two functions are reduced to the bare mimimum.
24+
two functions are reduced to the bare minimum.
2525

2626
The most important difference is that no waPC function is registered by the
2727
module. Calling any kind of waPC function from the host will result in an

tests/data/endless_wasm/wapc_endless_loop.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;;
33
;; This code cheats a little, from the outside it looks like any regular waPC module
44
;; because it exposes the two functions required by a waPC host. However, these
5-
;; two functions are reduced to the bare mimimum.
5+
;; two functions are reduced to the bare minimum.
66
;;
77
;; The most important difference is that no waPC function is registered by the
88
;; module. Calling any kind of waPC function from the host will result in an

0 commit comments

Comments
 (0)