Spell Check
Automated spell checking for documentation, code comments, and string literals using typos. It warns on typos but does not fail CI.
Reference
Section titled “Reference”| Field | Value |
|---|---|
| Workflow | .github/workflows/spell-check.yml |
| Configuration | .typos.toml |
| Behavior | Warns on typos, does not fail CI |
Triggers
Section titled “Triggers”The workflow runs on every push to main/master, all pull requests, and manual workflow dispatch. It scans all files (except excluded paths) for common typos and suggests corrections.
Warning output
Section titled “Warning output”warning: `recieve` should be `receive` --> crates/lib.rs:10Results are visible in the Actions tab.
How-to
Section titled “How-to”Check locally
Section titled “Check locally”# Install typoscargo install typos-cli
# Check for typostypos
# Auto-fix typostypos --write-changesVerify: typos exits without warnings on clean text.
Configure behavior
Section titled “Configure behavior”Edit .typos.toml:
[default]# Add regex patterns to ignoreextend-ignore-re = [ "[0-9a-f]{40}", # Git SHAs]
[files]# Exclude directories/filesextend-exclude = [ "target/", "*.lock",]
[default.extend-words]# Project-specific dictionary# "typo" = "correct"Verify: typos no longer flags the configured patterns.
Handle a false positive
Section titled “Handle a false positive”Accept a word as correct:
[default.extend-words]myword = "myword" # Accept as correctVerify: re-run typos and confirm the word is no longer flagged.
Exclude specific files
Section titled “Exclude specific files”[files]extend-exclude = [ "docs/legacy/",]Verify: typos skips the excluded paths.
Maintain a custom dictionary
Section titled “Maintain a custom dictionary”[default.extend-identifiers]# Code identifiersmyvar = "myvar"
[default.extend-words]# Documentation wordsspecialterm = "specialterm"Verify: typos treats the listed identifiers and words as correct.
Why this matters
Section titled “Why this matters”Typos in public-facing documentation, API names, and error messages erode trust and make a project look unmaintained, but a hard CI failure on every misspelling would block merges for trivial reasons and tempt contributors to disable the check entirely. Running typos as a non-blocking warning keeps spelling visible on every change without gatekeeping, and the configurable dictionary means domain terms and identifiers are accepted once rather than fought repeatedly.