Name | typos JSON |
Version |
1.28.4
JSON |
| download |
home_page | None |
Summary | Source Code Spelling Correction |
upload_time | 2024-12-16 21:24:53 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT OR Apache-2.0 |
keywords |
development
spelling
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# typos
> **Source code spell checker**
Finds and corrects spelling mistakes among source code:
- Fast enough to run on monorepos
- Low false positives so you can run on PRs
![Screenshot](./docs/screenshot.png)
[![codecov](https://codecov.io/gh/crate-ci/typos/branch/master/graph/badge.svg)](https://codecov.io/gh/crate-ci/typos)
[![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation]
![License](https://img.shields.io/crates/l/typos.svg)
[![Crates Status](https://img.shields.io/crates/v/typos.svg)][Crates.io]
Dual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE)
## Documentation
- [Installation](#install)
- [Getting Started](#getting-started)
- [False Positives](#false-positives)
- [Integrations](#integrations)
- [GitHub Action](docs/github-action.md)
- [pre-commit](docs/pre-commit.md)
- [Custom](#custom)
- [Debugging](#debugging)
- [Reference](docs/reference.md)
- [FAQ](#faq)
- [Comparison with other spell checkers](docs/comparison.md)
- [Projects using typos](https://github.com/crate-ci/typos/wiki)
- [Benchmarks](benchsuite/runs)
- [Design](docs/design.md)
- [Contribute](CONTRIBUTING.md)
- [CHANGELOG](CHANGELOG.md)
## Install
[Download](https://github.com/crate-ci/typos/releases) a pre-built binary
(installable via [gh-install](https://github.com/crate-ci/gh-install)).
Or use rust to install:
```console
$ cargo install typos-cli
```
Or use [Homebrew](https://brew.sh/) to install:
```console
$ brew install typos-cli
```
Or use [Conda](https://conda.io/) to install:
```console
$ conda install typos
```
Or use [Pacman](https://wiki.archlinux.org/title/pacman) to install:
```
sudo pacman -S typos
```
## Getting Started
Most commonly, you'll either want to see what typos are available with
```console
$ typos
```
Or have them fixed
```console
$ typos --write-changes
$ typos -w
```
If there is any ambiguity (multiple possible corrections), `typos` will just report it to the user and move on.
### False Positives
Sometimes, what looks like a typo is intentional, like with people's names, acronyms, or localized content.
To mark a word or an identifier (grouping of words) as valid, add it your [`_typos.toml`](docs/reference.md) by declaring itself as the valid spelling:
```toml
[default]
extend-ignore-identifiers-re = [
# *sigh* this just isn't worth the cost of fixing
"AttributeID.*Supress.*",
]
[default.extend-identifiers]
# *sigh* this just isn't worth the cost of fixing
AttributeIDSupressMenu = "AttributeIDSupressMenu"
[default.extend-words]
# Don't correct the surname "Teh"
teh = "teh"
```
For cases like localized content, you can disable spell checking of file contents while still checking the file name:
```toml
[type.po]
extend-glob = ["*.po"]
check-file = false
```
(run `typos --type-list` to see configured file types)
If you need some more flexibility, you can completely exclude some files from consideration:
```toml
[files]
extend-exclude = ["localized/*.po"]
```
### Integrations
- [GitHub Actions](docs/github-action.md)
- [pre-commit](docs/pre-commit.md)
- [🐊Putout Processor](https://github.com/putoutjs/putout-processor-typos)
- [Visual Studio Code](https://github.com/tekumara/typos-vscode)
- [typos-lsp (Language Server Protocol server)](https://github.com/tekumara/typos-vscode)
#### Custom
`typos` provides several building blocks for custom native integrations
- `-` reads from `stdin`, `--write-changes` will be written to `stdout`
- `--diff` to provide a diff
- `--format json` to get jsonlines with exit code 0 on no errors, code 2 on typos, anything else is an error.
Examples:
```console
$ # Read file from stdin, write corrected version to stdout
$ typos - --write-changes
$ # Creates a diff of what would change
$ typos dir/file --diff
$ # Fully programmatic control
$ typos dir/file --format json
```
### Debugging
You can see what the effective config looks like by running
```console
$ typos --dump-config -
```
You can then see how typos is processing your project with
```console
$ typos --files
$ typos --identifiers
$ typos --words
```
If you need to dig in more, you can enable debug logging with `-v`
## FAQ
### Why was ... not corrected?
**Does the file show up in `typos --files`?**
If not, check your config with `typos --dump-config -`.
The `[files]` table controls how we walk files.
If you are using `files.extend-exclude`,
are you running into [#593](https://github.com/crate-ci/typos/issues/593)?
If you are using `files.ignore-vcs = true`,
is the file in your `.gitignore` but git tracks it anyways?
Prefer allowing the file explicitly (see [#909](https://github.com/crate-ci/typos/issues/909)).
**Does the identifier show up in `typos --identifiers` or the word show up in `typos --words`?**
If not, it might be subject to one of typos' heuristics for
detecting non-words (like hashes) or
unambiguous words (like words after a `\` escape).
If it is showing up, likely `typos` doesn't know about it yet.
`typos` maintains a list of known typo corrections to keep the false positive
count low so it can safely run unassisted.
This is in contrast to most spell checking UIs people use where there is a
known list of valid words. In this case, the spell checker tries to guess your
intent by finding the closest-looking word. It then has a gauge for when a
word isn't close enough and assumes you know best. The user has the
opportunity to verify these corrections and explicitly allow or reject them.
For more on the trade offs of these approaches, see [Design](docs/design.md).
- To correct it locally, see also our [False Positives documentation](#false-positives).
- To contribute your correction, see [Contribute](CONTRIBUTING.md)
[Crates.io]: https://crates.io/crates/typos-cli
[Documentation]: https://docs.rs/typos
Raw data
{
"_id": null,
"home_page": null,
"name": "typos",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "development, spelling",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/52/26/b3c29fbf2726b8278578841a5f34ba244819660000b75d283a1afd1630a1/typos-1.28.4.tar.gz",
"platform": null,
"description": "# typos\n\n> **Source code spell checker**\n\nFinds and corrects spelling mistakes among source code:\n- Fast enough to run on monorepos\n- Low false positives so you can run on PRs\n\n![Screenshot](./docs/screenshot.png)\n\n[![codecov](https://codecov.io/gh/crate-ci/typos/branch/master/graph/badge.svg)](https://codecov.io/gh/crate-ci/typos)\n[![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation]\n![License](https://img.shields.io/crates/l/typos.svg)\n[![Crates Status](https://img.shields.io/crates/v/typos.svg)][Crates.io]\n\nDual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE)\n\n## Documentation\n\n- [Installation](#install)\n- [Getting Started](#getting-started)\n - [False Positives](#false-positives)\n - [Integrations](#integrations)\n - [GitHub Action](docs/github-action.md)\n - [pre-commit](docs/pre-commit.md)\n - [Custom](#custom)\n - [Debugging](#debugging)\n- [Reference](docs/reference.md)\n- [FAQ](#faq)\n- [Comparison with other spell checkers](docs/comparison.md)\n- [Projects using typos](https://github.com/crate-ci/typos/wiki)\n- [Benchmarks](benchsuite/runs)\n- [Design](docs/design.md)\n- [Contribute](CONTRIBUTING.md)\n- [CHANGELOG](CHANGELOG.md)\n\n## Install\n\n[Download](https://github.com/crate-ci/typos/releases) a pre-built binary\n(installable via [gh-install](https://github.com/crate-ci/gh-install)).\n\nOr use rust to install:\n```console\n$ cargo install typos-cli\n```\n\nOr use [Homebrew](https://brew.sh/) to install:\n```console\n$ brew install typos-cli\n```\n\nOr use [Conda](https://conda.io/) to install:\n```console\n$ conda install typos\n```\n\nOr use [Pacman](https://wiki.archlinux.org/title/pacman) to install:\n```\nsudo pacman -S typos\n```\n\n## Getting Started\n\nMost commonly, you'll either want to see what typos are available with\n```console\n$ typos\n```\n\nOr have them fixed\n```console\n$ typos --write-changes\n$ typos -w\n```\nIf there is any ambiguity (multiple possible corrections), `typos` will just report it to the user and move on.\n\n### False Positives\n\nSometimes, what looks like a typo is intentional, like with people's names, acronyms, or localized content.\n\nTo mark a word or an identifier (grouping of words) as valid, add it your [`_typos.toml`](docs/reference.md) by declaring itself as the valid spelling:\n```toml\n[default]\nextend-ignore-identifiers-re = [\n # *sigh* this just isn't worth the cost of fixing\n \"AttributeID.*Supress.*\",\n]\n\n[default.extend-identifiers]\n# *sigh* this just isn't worth the cost of fixing\nAttributeIDSupressMenu = \"AttributeIDSupressMenu\"\n\n[default.extend-words]\n# Don't correct the surname \"Teh\"\nteh = \"teh\"\n```\n\nFor cases like localized content, you can disable spell checking of file contents while still checking the file name:\n```toml\n[type.po]\nextend-glob = [\"*.po\"]\ncheck-file = false\n```\n(run `typos --type-list` to see configured file types)\n\nIf you need some more flexibility, you can completely exclude some files from consideration:\n```toml\n[files]\nextend-exclude = [\"localized/*.po\"]\n```\n\n### Integrations\n\n- [GitHub Actions](docs/github-action.md)\n- [pre-commit](docs/pre-commit.md)\n- [\ud83d\udc0aPutout Processor](https://github.com/putoutjs/putout-processor-typos)\n- [Visual Studio Code](https://github.com/tekumara/typos-vscode)\n- [typos-lsp (Language Server Protocol server)](https://github.com/tekumara/typos-vscode)\n\n#### Custom\n\n`typos` provides several building blocks for custom native integrations\n- `-` reads from `stdin`, `--write-changes` will be written to `stdout`\n- `--diff` to provide a diff\n- `--format json` to get jsonlines with exit code 0 on no errors, code 2 on typos, anything else is an error.\n\nExamples:\n```console\n$ # Read file from stdin, write corrected version to stdout\n$ typos - --write-changes\n$ # Creates a diff of what would change\n$ typos dir/file --diff\n$ # Fully programmatic control\n$ typos dir/file --format json\n```\n\n### Debugging\n\nYou can see what the effective config looks like by running\n```console\n$ typos --dump-config -\n```\n\nYou can then see how typos is processing your project with\n```console\n$ typos --files\n$ typos --identifiers\n$ typos --words\n```\n\nIf you need to dig in more, you can enable debug logging with `-v`\n\n## FAQ\n\n### Why was ... not corrected?\n\n**Does the file show up in `typos --files`?**\nIf not, check your config with `typos --dump-config -`.\nThe `[files]` table controls how we walk files.\nIf you are using `files.extend-exclude`,\nare you running into [#593](https://github.com/crate-ci/typos/issues/593)?\nIf you are using `files.ignore-vcs = true`,\nis the file in your `.gitignore` but git tracks it anyways?\nPrefer allowing the file explicitly (see [#909](https://github.com/crate-ci/typos/issues/909)).\n\n**Does the identifier show up in `typos --identifiers` or the word show up in `typos --words`?**\nIf not, it might be subject to one of typos' heuristics for\ndetecting non-words (like hashes) or\nunambiguous words (like words after a `\\` escape).\n\nIf it is showing up, likely `typos` doesn't know about it yet.\n\n`typos` maintains a list of known typo corrections to keep the false positive\ncount low so it can safely run unassisted.\n\nThis is in contrast to most spell checking UIs people use where there is a\nknown list of valid words. In this case, the spell checker tries to guess your\nintent by finding the closest-looking word. It then has a gauge for when a\nword isn't close enough and assumes you know best. The user has the\nopportunity to verify these corrections and explicitly allow or reject them.\n\nFor more on the trade offs of these approaches, see [Design](docs/design.md).\n\n- To correct it locally, see also our [False Positives documentation](#false-positives).\n- To contribute your correction, see [Contribute](CONTRIBUTING.md)\n\n[Crates.io]: https://crates.io/crates/typos-cli\n[Documentation]: https://docs.rs/typos\n\n",
"bugtrack_url": null,
"license": "MIT OR Apache-2.0",
"summary": "Source Code Spelling Correction",
"version": "1.28.4",
"project_urls": {
"Source Code": "https://github.com/crate-ci/typos"
},
"split_keywords": [
"development",
" spelling"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ff0300d37e1992013a5c50ad21600d79a4cdf8a6c34e688cc06bb7c857249c24",
"md5": "73c2d934a25cce1562384a52a14ede78",
"sha256": "0bb4945868432848bdb378137411f0c5d6f7f763e4da64b84b037ad2392b45f8"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "73c2d934a25cce1562384a52a14ede78",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3239364,
"upload_time": "2024-12-16T21:24:29",
"upload_time_iso_8601": "2024-12-16T21:24:29.917189Z",
"url": "https://files.pythonhosted.org/packages/ff/03/00d37e1992013a5c50ad21600d79a4cdf8a6c34e688cc06bb7c857249c24/typos-1.28.4-py3-none-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "81cd65a7d392bae05fa970efd1a73497f68b2e97d96a690be5b96a6534940086",
"md5": "d2fae51884b8f1a23de21591ed7db429",
"sha256": "54d507db5439e65ebb36a15551ba0fd23d317ed6d4212d0b866a5310a14d8841"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "d2fae51884b8f1a23de21591ed7db429",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3114865,
"upload_time": "2024-12-16T21:24:33",
"upload_time_iso_8601": "2024-12-16T21:24:33.243813Z",
"url": "https://files.pythonhosted.org/packages/81/cd/65a7d392bae05fa970efd1a73497f68b2e97d96a690be5b96a6534940086/typos-1.28.4-py3-none-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "626e84fe32eacaf2cc07647536f85c3d8329f804056d2c38b2294770b25a6c07",
"md5": "7f45821b050d26d17e309b2b9eec6e1e",
"sha256": "bacfb01a2ab60b146f1412252f327e58e32a430613a761d76dbcc6e275ecffe3"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "7f45821b050d26d17e309b2b9eec6e1e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4530518,
"upload_time": "2024-12-16T21:24:36",
"upload_time_iso_8601": "2024-12-16T21:24:36.226139Z",
"url": "https://files.pythonhosted.org/packages/62/6e/84fe32eacaf2cc07647536f85c3d8329f804056d2c38b2294770b25a6c07/typos-1.28.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9ca8ed642eff75832f1088a49414919d3d9323f1ea0ad467e65c7e122b2215c9",
"md5": "5831ce5ac570828d1e873a67d575498c",
"sha256": "b3bc312a10df63211b4f8730d551bc086f71ec5fb7a0a587a50f16c3902edf76"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "5831ce5ac570828d1e873a67d575498c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3614918,
"upload_time": "2024-12-16T21:24:37",
"upload_time_iso_8601": "2024-12-16T21:24:37.947701Z",
"url": "https://files.pythonhosted.org/packages/9c/a8/ed642eff75832f1088a49414919d3d9323f1ea0ad467e65c7e122b2215c9/typos-1.28.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1c89974ef4925ba63aa5678157724eb96626b649e8601840821527e550b32a7f",
"md5": "7a1f32bbb334f0b989a2ca2d5c38563e",
"sha256": "f605b3bb8c928cc0a0d46b29335d400630d43da0a9977bc890987a6cc175420a"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "7a1f32bbb334f0b989a2ca2d5c38563e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4339147,
"upload_time": "2024-12-16T21:24:41",
"upload_time_iso_8601": "2024-12-16T21:24:41.359223Z",
"url": "https://files.pythonhosted.org/packages/1c/89/974ef4925ba63aa5678157724eb96626b649e8601840821527e550b32a7f/typos-1.28.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "63acbbb69d77ae50106685a488aec676a6b43e1147dcd80ef0133a65c931fc54",
"md5": "27a61977626ec25d29988b2a092b4400",
"sha256": "d854c5f854304efb959d7fe56fef5720163738687a6db6232bbd951ee2190167"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-musllinux_1_2_aarch64.whl",
"has_sig": false,
"md5_digest": "27a61977626ec25d29988b2a092b4400",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3567775,
"upload_time": "2024-12-16T21:24:44",
"upload_time_iso_8601": "2024-12-16T21:24:44.364146Z",
"url": "https://files.pythonhosted.org/packages/63/ac/bbb69d77ae50106685a488aec676a6b43e1147dcd80ef0133a65c931fc54/typos-1.28.4-py3-none-musllinux_1_2_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "480cb7d85b3665d98e6f0eed10d534fafb3753a0712f07e86353be8cc86d2836",
"md5": "5ddb94d7ccd9ad1522f931ea6fbe4f7e",
"sha256": "ce87ddde847c535354dbe036691473fc6029f2c895f47340167874185b14bb29"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "5ddb94d7ccd9ad1522f931ea6fbe4f7e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4400492,
"upload_time": "2024-12-16T21:24:47",
"upload_time_iso_8601": "2024-12-16T21:24:47.324078Z",
"url": "https://files.pythonhosted.org/packages/48/0c/b7d85b3665d98e6f0eed10d534fafb3753a0712f07e86353be8cc86d2836/typos-1.28.4-py3-none-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "63d98c5ac1d74ba3a4793b6ed41c404e9ac6af1337586311cc4da8fe2281fc7c",
"md5": "7ca41c782e8bc7ae80dfa96894336760",
"sha256": "92a1a2eaa88f682f9f23152d3f20c932d64e18390819e69b2d006c3e83afe3e3"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-win32.whl",
"has_sig": false,
"md5_digest": "7ca41c782e8bc7ae80dfa96894336760",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 2632332,
"upload_time": "2024-12-16T21:24:48",
"upload_time_iso_8601": "2024-12-16T21:24:48.974913Z",
"url": "https://files.pythonhosted.org/packages/63/d9/8c5ac1d74ba3a4793b6ed41c404e9ac6af1337586311cc4da8fe2281fc7c/typos-1.28.4-py3-none-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "af593761e517c9ad49fcb588d87ebe339aa07a90cac5e749e9de70fa7183d337",
"md5": "757e07f458aabe48552410dffb08623d",
"sha256": "23dbb854917e4d8eaba6ff364d4849d09fc70faeb0f88bc35c814b622b6d045a"
},
"downloads": -1,
"filename": "typos-1.28.4-py3-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "757e07f458aabe48552410dffb08623d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 2779568,
"upload_time": "2024-12-16T21:24:50",
"upload_time_iso_8601": "2024-12-16T21:24:50.846700Z",
"url": "https://files.pythonhosted.org/packages/af/59/3761e517c9ad49fcb588d87ebe339aa07a90cac5e749e9de70fa7183d337/typos-1.28.4-py3-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5226b3c29fbf2726b8278578841a5f34ba244819660000b75d283a1afd1630a1",
"md5": "a3580b5eb21c05d0209cba916133d294",
"sha256": "7afd8ad79ab8b84f7adb12350d5630abc5e061c8a76802ddbc29eea256689600"
},
"downloads": -1,
"filename": "typos-1.28.4.tar.gz",
"has_sig": false,
"md5_digest": "a3580b5eb21c05d0209cba916133d294",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 1127000,
"upload_time": "2024-12-16T21:24:53",
"upload_time_iso_8601": "2024-12-16T21:24:53.456990Z",
"url": "https://files.pythonhosted.org/packages/52/26/b3c29fbf2726b8278578841a5f34ba244819660000b75d283a1afd1630a1/typos-1.28.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 21:24:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crate-ci",
"github_project": "typos",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "typos"
}