Skip to content

Commit c30d806

Browse files
authored
ci: add spell check (#82)
for code greater use spell check Signed-off-by: jokemanfire <[email protected]>
1 parent d5c4bf0 commit c30d806

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

.github/workflows/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ jobs:
6060

6161
- name: Run clippy
6262
run: cargo clippy --all-targets --all-features -- -D warnings
63+
64+
spelling:
65+
name: spell check with typos
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: Spell Check Repo
70+
uses: crate-ci/typos@master
6371

6472
test:
6573
name: Run Tests

crates/rmcp-macros/src/tool.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
213213
// let mut fommated_fn_args: Punctuated<FnArg, Comma> = Punctuated::new();
214214
let mut unextractable_args_indexes = HashSet::new();
215215
for (index, mut fn_arg) in input_fn.sig.inputs.iter_mut().enumerate() {
216-
enum Catched {
216+
enum Caught {
217217
Param(ToolFnParamAttrs),
218218
Aggregated(PatType),
219219
}
220-
let mut catched = None;
220+
let mut caught = None;
221221
match &mut fn_arg {
222222
FnArg::Receiver(_) => {
223223
continue;
@@ -244,15 +244,15 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
244244
"input param must have an ident as name",
245245
));
246246
};
247-
catched.replace(Catched::Param(ToolFnParamAttrs {
247+
caught.replace(Caught::Param(ToolFnParamAttrs {
248248
serde_meta: Vec::new(),
249249
schemars_meta: Vec::new(),
250250
ident: arg_ident,
251251
rust_type: pat_type.ty.clone(),
252252
}));
253253
}
254254
ParamMarker::Aggregated => {
255-
catched.replace(Catched::Aggregated(pat_type.clone()));
255+
caught.replace(Caught::Aggregated(pat_type.clone()));
256256
}
257257
}
258258
} else if meta_list.path.is_ident(SERDE_IDENT) {
@@ -268,8 +268,8 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
268268
}
269269
}
270270
}
271-
match catched {
272-
Some(Catched::Param(mut param)) => {
271+
match caught {
272+
Some(Caught::Param(mut param)) => {
273273
param.serde_meta = serde_metas;
274274
param.schemars_meta = schemars_metas;
275275
match &mut tool_macro_attrs.params {
@@ -282,7 +282,7 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
282282
}
283283
unextractable_args_indexes.insert(index);
284284
}
285-
Some(Catched::Aggregated(rust_type)) => {
285+
Some(Caught::Aggregated(rust_type)) => {
286286
tool_macro_attrs.params = ToolParams::Aggregated { rust_type };
287287
unextractable_args_indexes.insert(index);
288288
}

examples/rig-integration/src/chat.rs

+17-3
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,24 @@ pub async fn output_error(
7474
e: impl std::fmt::Display,
7575
output: &mut BufWriter<tokio::io::Stdout>,
7676
) -> std::io::Result<()> {
77-
output.write_all(b"\x1b[31mERROR: \x1b[0m").await?;
77+
output
78+
.write_all(b"\x1b[1;31m\xE2\x9D\x8C ERROR: \x1b[0m")
79+
.await?;
7880
output.write_all(e.to_string().as_bytes()).await?;
7981
output.write_all(b"\n").await?;
82+
output.flush().await?;
8083
Ok(())
8184
}
8285

8386
pub async fn output_agent(
8487
content: impl std::fmt::Display,
8588
output: &mut BufWriter<tokio::io::Stdout>,
8689
) -> std::io::Result<()> {
90+
output
91+
.write_all(b"\x1b[1;34m\xF0\x9F\xA4\x96 Agent: \x1b[0m")
92+
.await?;
8793
output.write_all(content.to_string().as_bytes()).await?;
94+
output.write_all(b"\n").await?;
8895
output.flush().await?;
8996
Ok(())
9097
}
@@ -93,22 +100,29 @@ pub async fn stream_output_toolcall(
93100
content: impl std::fmt::Display,
94101
output: &mut BufWriter<tokio::io::Stdout>,
95102
) -> std::io::Result<()> {
96-
output.write_all(b"\x1b[33mtool>\x1b[0m ").await?;
103+
output
104+
.write_all(b"\x1b[1;33m\xF0\x9F\x9B\xA0 Tool Call: \x1b[0m")
105+
.await?;
97106
output.write_all(content.to_string().as_bytes()).await?;
98107
output.write_all(b"\n").await?;
108+
output.flush().await?;
99109
Ok(())
100110
}
101111

102112
pub async fn stream_output_agent_start(
103113
output: &mut BufWriter<tokio::io::Stdout>,
104114
) -> std::io::Result<()> {
105-
output.write_all(b"\x1b[34magent>\x1b[0m ").await?;
115+
output
116+
.write_all(b"\x1b[1;34m\xF0\x9F\xA4\x96 Agent: \x1b[0m")
117+
.await?;
118+
output.flush().await?;
106119
Ok(())
107120
}
108121

109122
pub async fn stream_output_agent_finished(
110123
output: &mut BufWriter<tokio::io::Stdout>,
111124
) -> std::io::Result<()> {
112125
output.write_all(b"\n").await?;
126+
output.flush().await?;
113127
Ok(())
114128
}

0 commit comments

Comments
 (0)