2019-10-25 10:17:58 -04:00
# `typos` Reference
## Configuration
### Sources
Configuration is read from the following (in precedence order)
- Command line arguments
2019-10-25 11:39:55 -04:00
- File specified via `--config PATH`
2023-09-08 13:26:20 -04:00
- 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.
2019-10-25 10:17:58 -04:00
### Config Fields
| Field | Argument | Format | Description |
|------------------------|-------------------|--------|-------------|
2021-05-20 21:55:32 -04:00
| files.binary | --binary | bool | Check binary files as text |
| files.extend-exclude | --exclude | list of strings | Typos-specific ignore globs (gitignore syntax) |
2023-10-09 16:43:21 -04:00
| \- | --force-exclude | bool | Respect excluded files even for paths passed explicitly. |
2020-05-27 21:46:41 -04:00
| 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. |
2021-01-05 11:35:43 -05:00
| default.binary | --binary | bool | Check binary files as text |
2020-05-27 21:46:41 -04:00
| default.check-filename | \- | bool | Verifying spelling in file names. |
| default.check-file | \- | bool | Verifying spelling in files. |
2021-04-30 11:32:15 -04:00
| default.unicode | --unicode | bool | Allow unicode characters in identifiers (and not just ASCII) |
2021-03-01 21:37:05 -05:00
| default.locale | --locale | en, en-us, en-gb, en-ca, en-au | English dialect to correct to. |
2023-03-18 02:25:39 -04:00
| default.extend-ignore-re | \- | list of [regexes ](https://docs.rs/regex/latest/regex/index.html#syntax ) | Custom uncorrectable sections (e.g. markdown code fences, PGP signatures, etc) |
2023-01-03 08:06:02 -05:00
| default.extend-identifiers | \- | table of strings | Corrections for [identifiers ](./design.md#identifiers-and-words ). When the correction is blank, the identifier is never valid. When the correction is the key, the identifier is always valid. |
2023-03-17 23:40:55 -04:00
| default.extend-ignore-identifiers-re | \- | list of [regexes ](https://docs.rs/regex/latest/regex/index.html#syntax ) | Pattern-match always-valid identifiers |
2023-01-03 08:06:02 -05:00
| default.extend-words | \- | table of strings | Corrections for [words ](./design.md#identifiers-and-words ). When the correction is blank, the word is never valid. When the correction is the key, the word is always valid. |
2023-10-16 13:37:00 -04:00
| default.extend-ignore-words-re | \- | list of [regexes ](https://docs.rs/regex/latest/regex/index.html#syntax ) | Pattern-match always-valid words. Note: you must handle case insensitivity yourself |
2022-04-10 17:06:26 -04:00
| type.\<name>.\<field> | \<varied> | \<varied> | See `default.` for child keys. Run with `--type-list` to see available `<name>` s |
2023-03-18 00:37:57 -04:00
| type.\<name>.extend-glob | \- | list of strings | File globs for matching `<name>` |
2023-04-11 02:17:33 -04:00
Common `extend-ignore-identifiers-re` :
- SSL Cipher suites: `"\\bTLS_[A-Z0-9_]+(_anon_[A-Z0-9_]+)?\\b"`