Skip to content

Commit 8840e1f

Browse files
fix: fix typos and replace aspell CI with typos (#3937)
* Fix typos found in the codebase Thanks typos[1]! [1] https://github.com/crate-ci/typos * Add a typos.toml It makes typos ignore two syllabes files, and one non-typo in a file. * Replace aspell check with typos This works on all files instead of just the Markdown files, and already found many issues aspell missed. * fix: rename typos.toml to _typos.toml, use child_name, bump typos action - Rename typos.toml to _typos.toml (recommended convention) - Revert childs_name -> children_name; use child_name instead (original was possessive "child's", not plural) - Bump crate-ci/typos action from v1.39.2 to v1.44.0 - Fix new typo in CHANGELOG.md from master merge * docs: add typos spell checking section to CONTRIBUTING.md --------- Co-authored-by: Matt Yan <syan4@ualberta.ca>
1 parent a9b3978 commit 8840e1f

46 files changed

Lines changed: 75 additions & 245 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main-checks.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v6
2020
- name: Check spelling
21-
run: |
22-
sudo apt-get install aspell
23-
ci/spellcheck.sh list
21+
uses: crate-ci/typos@v1.44.0
2422

2523
doc_tests:
2624
name: Documentation Tests

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
- Better diagnostics for byte literals in `html!`. [[@Tim Kurdov](https://github.com/its-the-shrimp), [#3441](https://github.com/yewstack/yew/pull/3441)]
6060
- Concise diagnostics for missing props. [[@Siyuan Yan](https://github.com/Madoshakalaka), [#3873](https://github.com/yewstack/yew/pull/3873)]
6161
- Use the namespace when xmlns attributes are specified. [[@JasonCG](https://github.com/jasoncg), [#3629](https://github.com/yewstack/yew/pull/3629)]
62-
- Fix generic type missing erros in hooks. [[@Michael Meyer](https://github.com/Ichmed), [#3633](https://github.com/yewstack/yew/pull/3633)]
62+
- Fix generic type missing errors in hooks. [[@Michael Meyer](https://github.com/Ichmed), [#3633](https://github.com/yewstack/yew/pull/3633)]
6363
- Better duplicate key diagnostics. [[@WorldSEnder](https://github.com/WorldSEnder), [#3785](https://github.com/yewstack/yew/pull/3785)]
6464
- Fix autocompletion in html macro for rust-analyzer. [[@Moritz Hedtke](https://github.com/mohe2015), [#3829](https://github.com/yewstack/yew/pull/3829)]
6565
- `#[hook]`: `clippy::multiple_bound_locations` lint no longer triggered. [[@Tim Kurdov](https://github.com/its-the-shrimp), [#3803](https://github.com/yewstack/yew/pull/3803)]

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ These errors can change with each release of the compiler, so they should be gen
5757

5858
To update or generate a new `stderr` file you can run `cargo make test-overwrite` in the `yew-macro` directory.
5959

60+
## Spell Checking
61+
62+
We use [typos](https://github.com/crate-ci/typos) to catch spelling mistakes. CI runs it automatically on every PR.
63+
64+
To run it locally:
65+
66+
```bash
67+
cargo install typos-cli --locked
68+
typos # check for typos
69+
typos -w # auto-fix typos
70+
```
71+
72+
False positives can be configured in `_typos.toml` at the repo root.
73+
6074
## Linting
6175

6276
The following command checks the code using Rustfmt and Clippy:

_typos.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[files]
2+
extend-exclude = ["examples/router/data/syllables.txt", "examples/function_router/data/syllables.txt"]
3+
4+
[default.extend-words]
5+
ba = "ba"

ci/dictionary.txt

Lines changed: 0 additions & 86 deletions
This file was deleted.

ci/spellcheck.sh

Lines changed: 0 additions & 101 deletions
This file was deleted.

examples/async_clock/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl Component for AsyncComponent {
7171

7272
// In parallel we launch a background task that produces jokes to make the clock
7373
// more fun to watch. The jokes are emitted back to the component
74-
// throught the Msg::Joke callback.
74+
// through the Msg::Joke callback.
7575
let joke_cb = ctx.link().callback(Msg::Joke);
7676
emit_jokes(joke_cb);
7777
}

examples/communication_child_to_parent/src/parent.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ impl Component for Parent {
2424

2525
fn update(&mut self, _ctx: &Context<Self>, msg: Self::Message) -> bool {
2626
match msg {
27-
Msg::ButtonClick(childs_name) => {
27+
Msg::ButtonClick(child_name) => {
2828
// Keep track of the name of the child that was clicked
29-
self.last_updated = Some(childs_name);
29+
self.last_updated = Some(child_name);
3030

3131
// Increment the total number of clicks
3232
self.total_clicks += 1;

examples/communication_grandchild_with_grandparent/src/grandparent.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ impl Component for GrandParent {
2424

2525
fn update(&mut self, _ctx: &Context<Self>, msg: Self::Message) -> bool {
2626
match msg {
27-
Msg::ButtonClick(childs_name) => {
27+
Msg::ButtonClick(child_name) => {
2828
// Update the shared state
2929
let shared_state = Rc::make_mut(&mut self.state);
3030
shared_state.total_clicks += 1;
31-
shared_state.last_clicked = Some(childs_name);
31+
shared_state.last_clicked = Some(child_name);
3232
true
3333
}
3434
}

examples/communication_grandparent_to_grandchild/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Yew • Granparent-to-GrandChild Communication</title>
5+
<title>Yew • Grandparent-to-Grandchild Communication</title>
66
<link data-trunk rel="rust" />
77
<link data-trunk rel="sass" href="index.scss" />
88
</head>

0 commit comments

Comments
 (0)