Source code spell checker
Find a file
renovate[bot] d64f202a88
Some checks are pending
Security audit / security_audit (push) Waiting to run
Security audit / cargo_deny (bans licenses sources) (push) Waiting to run
CI / CI (push) Blocked by required conditions
CI / Test (push) Waiting to run
CI / Check MSRV (push) Waiting to run
CI / lockfile (push) Waiting to run
CI / Docs (push) Waiting to run
CI / rustfmt (push) Waiting to run
CI / clippy (push) Waiting to run
CI / Coverage (push) Waiting to run
/ linux (aarch64) (push) Waiting to run
/ linux (x86) (push) Waiting to run
/ linux (x86_64) (push) Waiting to run
/ musllinux (aarch64) (push) Waiting to run
/ musllinux (x86_64) (push) Waiting to run
/ windows (x64) (push) Waiting to run
/ windows (x86) (push) Waiting to run
/ macos (aarch64) (push) Waiting to run
/ macos (x86_64) (push) Waiting to run
/ sdist (push) Waiting to run
/ Release (push) Blocked by required conditions
pre-commit / pre-commit (push) Waiting to run
chore(deps): Update compatible (#1137)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anstream](https://redirect.github.com/rust-cli/anstyle) |
dependencies | patch | `0.6.15` -> `0.6.17` |
| [anstyle](https://redirect.github.com/rust-cli/anstyle) | dependencies
| patch | `1.0.8` -> `1.0.9` |
| [anyhow](https://redirect.github.com/dtolnay/anyhow) | dependencies |
patch | `1.0.89` -> `1.0.91` |
| [clap](https://redirect.github.com/clap-rs/clap) | dependencies |
patch | `4.5.18` -> `4.5.20` |
| [colorchoice-clap](https://redirect.github.com/rust-cli/anstyle) |
dependencies | patch | `1.0.5` -> `1.0.6` |
| [encoding_rs](https://docs.rs/encoding_rs/)
([source](https://redirect.github.com/hsivonen/encoding_rs)) |
dependencies | patch | `0.8.34` -> `0.8.35` |
| [human-panic](https://redirect.github.com/rust-cli/human-panic) |
dependencies | patch | `2.0.1` -> `2.0.2` |
| [indexmap](https://redirect.github.com/indexmap-rs/indexmap) |
dev-dependencies | minor | `2.5.0` -> `2.6.0` |
| [once_cell](https://redirect.github.com/matklad/once_cell) |
dependencies | patch | `1.20.1` -> `1.20.2` |
| [regex](https://redirect.github.com/rust-lang/regex) | dependencies |
patch | `1.11.0` -> `1.11.1` |
| [regex](https://redirect.github.com/rust-lang/regex) |
dev-dependencies | patch | `1.11.0` -> `1.11.1` |
| [serde](https://serde.rs)
([source](https://redirect.github.com/serde-rs/serde)) | dependencies |
patch | `1.0.210` -> `1.0.214` |
| [serde_json](https://redirect.github.com/serde-rs/json) | dependencies
| patch | `1.0.128` -> `1.0.132` |
|
[snapbox](https://redirect.github.com/assert-rs/trycmd/tree/main/crates/snapbox)
([source](https://redirect.github.com/assert-rs/snapbox)) |
dev-dependencies | patch | `0.6.17` -> `0.6.19` |
| [thiserror](https://redirect.github.com/dtolnay/thiserror) |
dependencies | patch | `1.0.64` -> `1.0.66` |
| [trycmd](https://redirect.github.com/assert-rs/trycmd)
([source](https://redirect.github.com/assert-rs/snapbox)) |
dev-dependencies | patch | `0.15.7` -> `0.15.8` |
| [unicase](https://redirect.github.com/seanmonstar/unicase) |
dev-dependencies | minor | `2.7.0` -> `2.8.0` |
| [unicase](https://redirect.github.com/seanmonstar/unicase) |
dependencies | minor | `2.7.0` -> `2.8.0` |

---

### Release Notes

<details>
<summary>rust-cli/anstyle (anstream)</summary>

###
[`v0.6.17`](https://redirect.github.com/rust-cli/anstyle/compare/anstream-v0.6.16...anstream-v0.6.17)

[Compare
Source](https://redirect.github.com/rust-cli/anstyle/compare/anstream-v0.6.16...anstream-v0.6.17)

###
[`v0.6.16`](https://redirect.github.com/rust-cli/anstyle/compare/anstream-v0.6.15...anstream-v0.6.16)

[Compare
Source](https://redirect.github.com/rust-cli/anstyle/compare/anstream-v0.6.15...anstream-v0.6.16)

</details>

<details>
<summary>dtolnay/anyhow (anyhow)</summary>

###
[`v1.0.91`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.91)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.90...1.0.91)

- Ensure OUT_DIR is left with deterministic contents after build script
execution
([#&#8203;388](https://redirect.github.com/dtolnay/anyhow/issues/388))

###
[`v1.0.90`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.90)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.89...1.0.90)

-   Documentation improvements

</details>

<details>
<summary>clap-rs/clap (clap)</summary>

###
[`v4.5.20`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4520---2024-10-08)

[Compare
Source](https://redirect.github.com/clap-rs/clap/compare/v4.5.19...v4.5.20)

##### Features

-   *(unstable)* Add `CommandExt`

###
[`v4.5.19`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4519---2024-10-01)

[Compare
Source](https://redirect.github.com/clap-rs/clap/compare/v4.5.18...v4.5.19)

##### Internal

-   Update dependencies

</details>

<details>
<summary>hsivonen/encoding_rs (encoding_rs)</summary>

###
[`v0.8.35`](https://redirect.github.com/hsivonen/encoding_rs/compare/v0.8.34...v0.8.35)

[Compare
Source](https://redirect.github.com/hsivonen/encoding_rs/compare/v0.8.34...v0.8.35)

</details>

<details>
<summary>rust-cli/human-panic (human-panic)</summary>

###
[`v2.0.2`](https://redirect.github.com/rust-cli/human-panic/blob/HEAD/CHANGELOG.md#202---2024-10-10)

[Compare
Source](https://redirect.github.com/rust-cli/human-panic/compare/v2.0.1...v2.0.2)

##### Fixes

-   Improve detection of what can be trimmed from backtrace

</details>

<details>
<summary>indexmap-rs/indexmap (indexmap)</summary>

###
[`v2.6.0`](https://redirect.github.com/indexmap-rs/indexmap/blob/HEAD/RELEASES.md#260-2024-10-01)

[Compare
Source](https://redirect.github.com/indexmap-rs/indexmap/compare/2.5.0...2.6.0)

-   Implemented `Clone` for `map::IntoIter` and `set::IntoIter`.
-   Updated the `hashbrown` dependency to version 0.15.

</details>

<details>
<summary>matklad/once_cell (once_cell)</summary>

###
[`v1.20.2`](https://redirect.github.com/matklad/once_cell/blob/HEAD/CHANGELOG.md#1202)

[Compare
Source](https://redirect.github.com/matklad/once_cell/compare/v1.20.1...v1.20.2)

- Remove `portable_atomic` from Cargo.lock if it is not, in fact, used:
[#&#8203;267](https://redirect.github.com/matklad/once_cell/pull/267)
This is a work-around for this cargo
b[https://github.com/rust-lang/cargo/issues/10801](https://redirect.github.com/rust-lang/cargo/issues/10801)0801.

</details>

<details>
<summary>rust-lang/regex (regex)</summary>

###
[`v1.11.1`](https://redirect.github.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#1111-2024-10-24)

[Compare
Source](https://redirect.github.com/rust-lang/regex/compare/1.11.0...1.11.1)

\===================
This is a new patch release of `regex` that fixes compilation on nightly
Rust when the unstable `pattern` crate feature is enabled. Users on
nightly
Rust without this feature enabled are unaffected.

Bug fixes:

- [BUG
#&#8203;1231](https://redirect.github.com/rust-lang/regex/issues/1231):
Fix the `Pattern` trait implementation as a result of nightly API
breakage.

</details>

<details>
<summary>serde-rs/serde (serde)</summary>

###
[`v1.0.214`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.214)

[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.213...v1.0.214)

- Implement IntoDeserializer for all Deserializers in serde:🇩🇪:value
module
([#&#8203;2568](https://redirect.github.com/serde-rs/serde/issues/2568),
thanks [@&#8203;Mingun](https://redirect.github.com/Mingun))

###
[`v1.0.213`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.213)

[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.212...v1.0.213)

- Fix support for macro-generated `with` attributes inside a newtype
struct
([#&#8203;2847](https://redirect.github.com/serde-rs/serde/issues/2847))

###
[`v1.0.212`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.212)

[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.211...v1.0.212)

- Fix hygiene of macro-generated local variable accesses in serde(with)
wrappers
([#&#8203;2845](https://redirect.github.com/serde-rs/serde/issues/2845))

###
[`v1.0.211`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.211)

[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.210...v1.0.211)

- Improve error reporting about mismatched signature in `with` and
`default` attributes
([#&#8203;2558](https://redirect.github.com/serde-rs/serde/issues/2558),
thanks [@&#8203;Mingun](https://redirect.github.com/Mingun))
- Show variant aliases in error message when variant deserialization
fails
([#&#8203;2566](https://redirect.github.com/serde-rs/serde/issues/2566),
thanks [@&#8203;Mingun](https://redirect.github.com/Mingun))
- Improve binary size of untagged enum and internally tagged enum
deserialization by about 12%
([#&#8203;2821](https://redirect.github.com/serde-rs/serde/issues/2821))

</details>

<details>
<summary>serde-rs/json (serde_json)</summary>

###
[`v1.0.132`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.132)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.131...1.0.132)

- Improve binary size and compile time for JSON array and JSON object
deserialization by about 50%
([#&#8203;1205](https://redirect.github.com/serde-rs/json/issues/1205))
- Improve performance of JSON array and JSON object deserialization by
about 8%
([#&#8203;1206](https://redirect.github.com/serde-rs/json/issues/1206))

###
[`v1.0.131`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.131)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.130...1.0.131)

- Implement Deserializer and IntoDeserializer for `Map<String, Value>`
and `&Map<String, Value>`
([#&#8203;1135](https://redirect.github.com/serde-rs/json/issues/1135),
thanks [@&#8203;swlynch99](https://redirect.github.com/swlynch99))

###
[`v1.0.130`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.130)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.129...1.0.130)

- Support converting and deserializing `Number` from i128 and u128
([#&#8203;1141](https://redirect.github.com/serde-rs/json/issues/1141),
thanks [@&#8203;druide](https://redirect.github.com/druide))

###
[`v1.0.129`](https://redirect.github.com/serde-rs/json/releases/tag/1.0.129)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/1.0.128...1.0.129)

- Add
[`serde_json::Map::sort_keys`](https://docs.rs/serde_json/1/serde_json/struct.Map.html#method.sort_keys)
and
[`serde_json::Value::sort_all_objects`](https://docs.rs/serde_json/1/serde_json/enum.Value.html#method.sort_all_objects)
([#&#8203;1199](https://redirect.github.com/serde-rs/json/issues/1199))

</details>

<details>
<summary>assert-rs/snapbox (snapbox)</summary>

###
[`v0.6.19`](https://redirect.github.com/assert-rs/snapbox/compare/snapbox-v0.6.18...snapbox-v0.6.19)

[Compare
Source](https://redirect.github.com/assert-rs/snapbox/compare/snapbox-v0.6.18...snapbox-v0.6.19)

###
[`v0.6.18`](https://redirect.github.com/assert-rs/snapbox/compare/snapbox-v0.6.17...snapbox-v0.6.18)

[Compare
Source](https://redirect.github.com/assert-rs/snapbox/compare/snapbox-v0.6.17...snapbox-v0.6.18)

</details>

<details>
<summary>dtolnay/thiserror (thiserror)</summary>

###
[`v1.0.66`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.66)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.65...1.0.66)

- Improve compile error on malformed format attribute
([#&#8203;327](https://redirect.github.com/dtolnay/thiserror/issues/327))

###
[`v1.0.65`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.65)

[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.64...1.0.65)

- Ensure OUT_DIR is left with deterministic contents after build script
execution
([#&#8203;325](https://redirect.github.com/dtolnay/thiserror/issues/325))

</details>

<details>
<summary>seanmonstar/unicase (unicase)</summary>

###
[`v2.8.0`](https://redirect.github.com/seanmonstar/unicase/compare/v2.7.0...v2.8.0)

[Compare
Source](https://redirect.github.com/seanmonstar/unicase/compare/v2.7.0...v2.8.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/crate-ci/typos).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMzUuMiIsInVwZGF0ZWRJblZlciI6IjM4LjEzNS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 02:26:34 +00:00
.cargo chore: Rename .cargo/{config => config.toml} 2022-09-01 09:14:02 +02:00
.github chore(ci): Fix new release process 2024-10-24 12:24:49 -05:00
action chore: Release 2024-10-24 12:24:56 -05:00
benchsuite test: Fix typo 2021-10-25 10:29:37 -05:00
crates chore: Fix typo "potemtial" -> "potential" 2024-10-30 22:30:28 +01:00
docs chore: Release 2024-10-24 12:24:56 -05:00
.clippy.toml chore(ci): Allow prelude wildcard imports 2024-04-26 11:36:19 -05:00
.dockerignore New dockerfile for #427. Builds on demand 2022-02-10 21:05:57 -08:00
.gitignore chore: Upgrade boilerplate 2022-02-15 13:31:29 -06:00
.ignore feat: Support english dialects 2020-08-20 19:37:37 -05:00
.pre-commit-config.yaml chore: Update from '_rust/main' 2023-12-04 11:08:40 -06:00
.pre-commit-hooks.yaml Updates stage names in .pre-commit-hooks.yaml. 2024-10-06 20:45:26 +02:00
action.yml fix(action): Don't require sudo 2023-05-22 13:30:04 -05:00
Cargo.lock chore(deps): Update compatible (#1137) 2024-11-01 02:26:34 +00:00
Cargo.toml perf: Improve release performance 2024-09-17 10:19:31 -05:00
CHANGELOG.md chore: Release 2024-10-24 12:24:56 -05:00
committed.toml chore: Switch to renovate 2022-12-01 11:20:06 -06:00
CONTRIBUTING.md chore: Update from _rust template 2024-09-27 13:33:54 -05:00
deny.toml chore: Update deny config 2024-05-29 16:15:19 -05:00
Dockerfile fixed the crate install path 2024-07-20 23:59:40 +02:00
LICENSE-APACHE Initial commit 2019-01-22 15:01:33 -07:00
LICENSE-MIT chore: First step 2023-03-29 14:33:22 -05:00
README.md Fix Typo in README: "identifer" to "identifier" 2024-03-06 08:33:15 +09:00
release.toml chore: Update release process 2022-10-25 07:08:45 -05:00
setup.py chore: Release 2024-10-24 12:24:56 -05:00

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

codecov Documentation License Crates Status

Dual-licensed under MIT or Apache 2.0

Documentation

Install

Download a pre-built binary (installable via gh-install).

Or use rust to install:

cargo install typos-cli

Or use Homebrew to install:

brew install typos-cli

Or use Conda to install:

conda install typos

Or use Pacman to install:

sudo pacman -S typos

Getting Started

Most commonly, you'll either want to see what typos are available with

typos

Or have them fixed

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 by declaring itself as the valid spelling:

[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:

[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:

[files]
extend-exclude = ["localized/*.po"]

Integrations

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:

# 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

typos --dump-config -

You can then see how typos is processing your project with

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? 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).

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.