codespell
TLDR
Check for misspellings in the current directory
SYNOPSIS
codespell [options] [path...]
DESCRIPTION
codespell is a tool designed to find and fix common misspellings in source code, documentation, and text files. It uses a curated dictionary of frequent typos and their corrections, making it effective at catching errors that regular spell checkers miss.
The tool is particularly useful in CI/CD pipelines to catch typos before they enter the codebase. It understands programming contexts and avoids false positives from intentional technical terms, variable names, and code patterns.
codespell can operate in check-only mode for verification, interactive mode for manual review, or write mode for automatic correction. Custom ignore lists allow adaptation to project-specific terminology that might otherwise trigger false positives.
PARAMETERS
-w, --write-changes
Automatically write corrections to files.-i N, --interactive N
Interactive mode: 0=no, 1=ask, 2=ask+confirm, 3=ask+show context.-I FILE, --ignore-words FILE
File containing words to ignore (one per line).-L WORDS, --ignore-words-list WORDS
Comma-separated list of words to ignore.--skip PATTERNS
Comma-separated glob patterns of files to skip.--include-file PATTERNS
Only check files matching these glob patterns.-d, --disable-colors
Disable colored output.--builtin DICT
Specify which built-in dictionaries to use.-q N, --quiet-level N
Set quiet level (0=normal, 1=hide warnings, 2=hide all).--count
Print only the count of misspellings.-h, --help
Display help information.
CAVEATS
Automatic write mode may incorrectly "fix" intentional non-standard spellings or technical jargon. The built-in dictionary focuses on English and common programming terms. Some valid technical terms may need to be added to an ignore list.
HISTORY
codespell was created by Lucas De Marchi and is maintained as an open-source project. It emerged from the need to catch common misspellings in large codebases, particularly in open-source projects with many contributors. The tool has been adopted by numerous projects including the Linux kernel.


