#spellcheck #spelling #grammar

bin+lib cargo-spellcheck

Checks all doc comments for spelling mistakes

94 releases

0.12.3 Nov 23, 2022
0.12.0 Aug 19, 2022
0.11.3 May 25, 2022
0.11.2 Mar 31, 2022
0.3.0 Jul 29, 2020

#91 in Cargo plugins

Download history 434/week @ 2022-10-13 494/week @ 2022-10-20 281/week @ 2022-10-27 488/week @ 2022-11-03 355/week @ 2022-11-10 544/week @ 2022-11-17 531/week @ 2022-11-24 225/week @ 2022-12-01 313/week @ 2022-12-08 266/week @ 2022-12-15 265/week @ 2022-12-22 297/week @ 2022-12-29 300/week @ 2023-01-05 298/week @ 2023-01-12 358/week @ 2023-01-19 255/week @ 2023-01-26

1,266 downloads per month


12K SLoC


crates.io CI commits-since rust 1.57.0+ badge

Check your spelling with hunspell and/or nlprule.

Use Cases

Run cargo spellcheck --fix or cargo spellcheck fix to fix all your documentation comments in order to avoid nasty typos all over your source tree. Meant as a helper simplifying review as well as improving CI checks after a learning phase for custom/topic specific lingo.

cargo-spellcheck is also a valuable tool to run from git commit hooks or CI/CD systems.

Check For Spelling and/or Grammar Mistakes

cargo spellcheck check
error: spellcheck
   --> src/main.rs:44
 44 | Fun facets shalld cause some erroris.
    |            ^^^^^^
    | - shall or shall d

Apply Suggestions Interactively

cargo spellcheck fix
error: spellcheck(Hunspell)
    --> /media/supersonic1t/projects/cargo-spellcheck/src/literalset.rs:291
 291 |  Returns literl within the Err variant if not adjacent
     |          ^^^^^^

(13/14) Apply this suggestion [y,n,q,a,d,j,e,?]?

   liter l
 » a custom replacement literal


cargo install --locked cargo-spellcheck

The --locked flag is the preferred way of installing to get the tested set of dependencies.


cargo spellcheck completions for autodetection of your current shell via $SHELL,


cargo spellcheck completions --shell zsh

to explicitly specify your shell type.

Commonly it's use like this from your shell's .rc* file:

source <(cargo spellcheck completion)

Note: There is a relevant clap issue (#3508) that makes this fail in some cases.

🎈 Contribute!

Contributions are very welcome!

Generally the preferred way of doing so, is to comment in an issue that you would like to tackle the implementation/fix.

This is usually followed by an initial PR where the implementation is then discussed and iteratively refined. No need to get it all correct the first time!



~690K SLoC