cargo-spellcheck 0.0.9

Checks all doc comments for spelling mistakes
cargo-spellcheck-0.0.9 is not a library.
Visit the last successful build: cargo-spellcheck-0.13.2

cargo-spellcheck

WIP Check your spelling. WIP

Usecase

Run cargo spellcheck --fix or cargo spellcheck fix to fix all your documentation comments in order to avoid narsty types all over the place.

Meant as a helper simplifying review as well as possibly improving CI after a learning phase for custom/topic specifc lingo. cargo spellcheck has a return code 1 if any unknown words are found, and 0 on success.

Error display follows cargo error printing style:

Features

  • Parse doc comments from arbitrary files
  • Decent error printing
  • cargo-spellcheck check
  • Spell checking using hunspell
  • Merge multiline doc comments
  • Grammar check using languagetool http API
  • False positive reduction
  • Be markdown aware
  • Include doctests ( ```rust code wrapped sections)
  • Handle module documentation comments
  • Add README.md files
  • Follow module declarations rather than blindly recurse
  • Handle cargo workspaces
  • cargo-spellcheck fix
  • cargo-spellcheck fix --interactive
  • Re-wrap doc comments
  • Word split validation

hunspell and languagetool are currently the two supported featuresets.

Configuration

# Linux:   /home/alice/.config/cargo_spellcheck/config.toml
# Windows: C:\Users\Alice\AppData\Roaming\cargo_spellcheck\config.toml
# macOS:   /Users/Alice/Library/Preferences/cargo_spellcheck/config.toml
[LanguageTool]
url = "192.168.1.1:8010"

[Hunspell]
# lang and name of `.dic` file
lang = "en_US"
# OS specific additives
# Linux: [ /usr/share/myspell ]
# Windows: []
# macOS [ /home/alice/Libraries/hunspell, /Libraries/hunspell ]
search_dirs = []
extra_dictonaries = []

Installation

cargo install cargo-spellcheck

Hunspell

Requires the native library

dnf install -y hunspell-devel

and building should succeed just fine.

LanguageTool

Run a instance of the LanguageTool server i.e. as container .