2025-03-14 21:59:59 -06:00
|
|
|
# codespell
|
|
|
|
|
|
|
|
|
|
> Spellchecker for source code.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://manned.org/codespell>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Check for typos in all text files in the current directory, recursively:
|
|
|
|
|
|
|
|
|
|
`codespell`
|
|
|
|
|
|
|
|
|
|
- Correct all typos found in-place:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{[-w|--write-changes]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Skip files with names that match the specified pattern (accepts a comma-separated list of patterns using wildcards):
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{[-S|--skip]}} "{{pattern}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Use a custom dictionary file when checking (`--dictionary` can be used multiple times):
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{[-D|--dictionary]}} {{path/to/file.txt}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Do not check words that are listed in the specified file:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{[-I|--ignore-words]}} {{path/to/file.txt}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Do not check the specified words:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{[-L|--ignore-words-list]}} {{ignored_word1,ignored_word2,...}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{--context|--before-context|--after-context}} 3`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Check file names for typos, in addition to file contents:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`codespell {{[-f|--check-filenames]}}`
|