Forrest logo
tool overview
On this page you find all important commands for the CLI tool codespell. If the command you are looking for is missing please ask our AI.

codespell

Codespell is a command line tool used for detecting and correcting spelling mistakes in source code files. It is particularly helpful in identifying typos and misspellings in variable names, comments, and documentation within codebases.

Developed using Python, codespell scans the specified files or directories recursively and compares the identified words against a dictionary. In case of a mismatch, it suggests corrections for the misspelled words. It supports various programming languages, including C, C++, Python, Java, and Ruby.

Codespell provides options to control the suggestions given, such as ignoring certain words or directories, checking only specific file types, and adjusting verbosity levels. It also offers the ability to automatically replace the incorrect words with the suggested corrections.

By using codespell, developers can ensure consistency, clarity, and professionalism in their codebases, contributing to better readability and maintainability. It helps minimize confusion caused by typographical errors and enhances the overall quality of source code.

List of commands for codespell:

  • codespell:tldr:13430 codespell: Print 3 lines of context around, before or after each match.
    $ codespell --${select} ${3}
    try on your machine
    explain this command
  • codespell:tldr:1feb2 codespell: Check for typos in all text files in the current directory, recursively.
    $ codespell
    try on your machine
    explain this command
  • codespell:tldr:26d32 codespell: Use a custom dictionary file when checking (`--dictionary` can be used multiple times).
    $ codespell --dictionary ${filename-txt}
    try on your machine
    explain this command
  • codespell:tldr:bb153 codespell: Do not check the specified words.
    $ codespell --ignore-words-list ${words,to,ignore}
    try on your machine
    explain this command
  • codespell:tldr:ccfb0 codespell: Check file names for typos, in addition to file contents.
    $ codespell --check-filenames
    try on your machine
    explain this command
  • codespell:tldr:cdd1b codespell: Do not check words that are listed in the specified file.
    $ codespell --ignore-words ${filename-txt}
    try on your machine
    explain this command
  • codespell:tldr:d475b codespell: Correct all typos found in-place.
    $ codespell --write-changes
    try on your machine
    explain this command
  • codespell:tldr:ffdf3 codespell: Skip files with names that match the specified pattern (accepts a comma-separated list of patterns using wildcards).
    $ codespell --skip "${pattern}"
    try on your machine
    explain this command
tool overview