Scroll to navigation

CODESPELL(1) User Commands CODESPELL(1)

NAME

codespell - detect spelling mistakes in source code

SYNOPSIS

codespell [OPTIONS] [file1 file2 ... fileN]

DESCRIPTION

codespell is designed to find and fix common misspellings in text files. It is designed primarily for checking misspelled words in source code, but it can be used with other files as well.

OPTIONS

--version
show program's version number and exit
-h, --help
show this help message and exit
-d, --disable-colors
disable colors even when printing to terminal (always on for Windows)
-c, --enable-colors
enable colors even when not printing to terminal
-w, --write-changes
write changes in place if possible
-D FILE, --dictionary=FILE
Custom dictionary file that contains spelling corrections. If this flag is not specified or equals "-" then the default dictionary is used. This option can be specified multiple times.
-I FILE, --ignore-words=FILE
File that contains words which will be ignored by codespell. File must contain 1 word per line. Words are case sensitive based on how they are written in codespell_lib/data/dictionary.txt
-L WORDS, --ignore-words-list=WORDS
Comma separated list of words to be ignored by codespell. Words are case sensitive based on how they are written in codespell_lib/data/dictionary.txt
-r REGEX, --regex=REGEX
Regular expression which is used to find words. By default any alphanumeric character, the underscore, the hyphen, and the apostrophe is used to build words (i.e. [\w\-'?`]+). This option cannot be specified together with the write-changes functionality.
-s, --summary
print summary of fixes
-S SKIP, --skip=SKIP
Comma-separated list of files to skip. It accepts globs as well. E.g.: if you want codespell to skip .eps and .txt files, you'd give "*.eps,*.txt" to this option.
-x FILE, --exclude-file=FILE
FILE with lines that should not be changed
-i INTERACTIVE, --interactive=INTERACTIVE
Set interactive mode when writing changes. 0 is the same as no interactivity; 1 makes codespell ask for confirmation; 2 ask user to choose one fix when more than one is available; 3 applies both 1 and 2
-q QUIET_LEVEL, --quiet-level=QUIET_LEVEL
Bitmask that allows codespell to run quietly. 0: the default, in which all messages are printed. 1: disable warnings about wrong encoding. 2: disable warnings about binary file. 4: shut down warnings about automatic fixes that were disabled in dictionary. 8: don't print anything for non-automatic fixes. 16: don't print fixed files.
-e, --hard-encoding-detection
Use chardet to detect the encoding of each file. This can slow down codespell, but is more reliable in detecting encodings other than utf-8, iso8859-1 and ascii.
-f, --check-filenames
Check file names as well.
-H, --check-hidden
Check hidden files (those starting with ".") as well.

AUTHOR

Lucas De Marchi <lucas.de.marchi@gmail.com>

SEE ALSO

https://github.com/codespell-project/codespell
October 2018 codespell 1.14.0