dev/typos.md
A quick guide on how to use typos to find, fix, and ignore typos.
# Replace `<version>` with the version installed in `dev/install-typos.sh`.
brew install typos-cli@<version>
See https://github.com/crate-ci/typos?tab=readme-ov-file#install for other installation methods.
pre-commit run --all-files typos
You can fix typos either manually or by running the following command:
typos --write-changes [PATH]
There are two ways to ignore false positives:
This option is preferred if the false positive is a one-off.
# Ignore a line containing a typo:
"<false_positive>" # spellchecker: disable-line
# Ignore a block containing typos:
# spellchecker: off
"<false_positive>"
"<another_false_positive>"
# spellchecker: on
pyproject.tomlThis option is preferred if the false positive is common across multiple files/lines.
# pyproject.toml
[tool.typos.default]
extend-ignore-re = [
...,
"false_positive",
]
typos doesn't recognize it?typos only recognizes typos that are in its dictionary.
If you find a typo that typos doesn't recognize,
you can extend the extend-words list in pyproject.toml.
# pyproject.toml
[tool.typos.default.extend-words]
...
mflow = "mlflow"