99 releases

0.14.0 Apr 24, 2024
0.13.2 Jan 5, 2024
0.13.1 Oct 10, 2023
0.12.4 Jul 3, 2023
0.3.0 Jul 29, 2020

#86 in Cargo plugins

Download history 487/week @ 2024-07-06 769/week @ 2024-07-13 558/week @ 2024-07-20 238/week @ 2024-07-27 318/week @ 2024-08-03 265/week @ 2024-08-10 360/week @ 2024-08-17 382/week @ 2024-08-24 492/week @ 2024-08-31 642/week @ 2024-09-07 681/week @ 2024-09-14 629/week @ 2024-09-21 628/week @ 2024-09-28 866/week @ 2024-10-05 645/week @ 2024-10-12 387/week @ 2024-10-19

2,596 downloads per month

MIT/Apache

7.5MB
13K SLoC

cargo-spellcheck

crates.io CI commits-since rust 1.70.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,?]?

   lite
   litter
   litterer
   liter l
   liters
   literal
   liter
 » a custom replacement literal

Installation

cargo install --locked cargo-spellcheck

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

Completions

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

or

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 completions)

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!

Documentation

Dependencies

~26–41MB
~738K SLoC