typos/docs/reference.md
2023-10-09 19:39:11 +00:00

3.1 KiB

typos Reference

Configuration

Sources

Configuration is read from the following (in precedence order)

  • Command line arguments
  • File specified via --config PATH
  • Search parents of specified file / directory for one of typos.toml, _typos.toml, .typos.toml, or pyproject.toml.
    • In the case of pyproject.toml, the below fields must be under the [tool.typos] section. If this section does not exist, the config file will be skipped.

Config Fields

Field Argument Format Description
files.binary --binary bool Check binary files as text
files.extend-exclude --exclude list of strings Typos-specific ignore globs (gitignore syntax)
file.force-excude --force-exclude bool Respect excluded files even for paths passed explicitly.
files.ignore-hidden --hidden bool Skip hidden files and directories.
files.ignore-files --ignore bool Respect ignore files.
files.ignore-dot --ignore-dot bool Respect .ignore files.
files.ignore-vcs --ignore-vcs bool Respect ignore files in vcs directories.
files.ignore-global --ignore-global bool Respect global ignore files.
files.ignore-parent --ignore-parent bool Respect ignore files in parent directories.
default.binary --binary bool Check binary files as text
default.check-filename - bool Verifying spelling in file names.
default.check-file - bool Verifying spelling in files.
default.unicode --unicode bool Allow unicode characters in identifiers (and not just ASCII)
default.locale --locale en, en-us, en-gb, en-ca, en-au English dialect to correct to.
default.extend-ignore-re - list of regexes Custom uncorrectable sections (e.g. markdown code fences, PGP signatures, etc)
default.extend-identifiers - table of strings Corrections for identifiers. When the correction is blank, the identifier is never valid. When the correction is the key, the identifier is always valid.
default.extend-ignore-identifiers-re - list of regexes Pattern-match always-valid identifiers
default.extend-words - table of strings Corrections for words. When the correction is blank, the word is never valid. When the correction is the key, the word is always valid.
type.<name>.<field> <varied> <varied> See default. for child keys. Run with --type-list to see available <name>s
type.<name>.extend-glob - list of strings File globs for matching <name>

Common extend-ignore-identifiers-re:

  • SSL Cipher suites: "\\bTLS_[A-Z0-9_]+(_anon_[A-Z0-9_]+)?\\b"