Source code spell checker
Find a file
renovate[bot] 9ab07a28ac
chore(deps): Update compatible (#1071)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anstream](https://togithub.com/rust-cli/anstyle) | dependencies |
patch | `0.6.14` -> `0.6.15` |
| [anstyle](https://togithub.com/rust-cli/anstyle) | dependencies |
patch | `1.0.7` -> `1.0.8` |
| [assert_fs](https://togithub.com/assert-rs/assert_fs) |
dev-dependencies | patch | `1.1.1` -> `1.1.2` |
| [bstr](https://togithub.com/BurntSushi/bstr) | dependencies | minor |
`1.9.1` -> `1.10.0` |
| [clap](https://togithub.com/clap-rs/clap) | dependencies | patch |
`4.5.8` -> `4.5.13` |
|
[clap-verbosity-flag](https://togithub.com/clap-rs/clap-verbosity-flag)
| dependencies | patch | `2.2.0` -> `2.2.1` |
| [codegenrs](https://togithub.com/crate-ci/codegenrs) |
dev-dependencies | patch | `3.0.1` -> `3.0.2` |
| [colorchoice-clap](https://togithub.com/rust-cli/anstyle) |
dependencies | patch | `1.0.4` -> `1.0.5` |
| [env_logger](https://togithub.com/rust-cli/env_logger) | dependencies
| patch | `0.11.3` -> `0.11.5` |
| [human-panic](https://togithub.com/rust-cli/human-panic) |
dependencies | patch | `2.0.0` -> `2.0.1` |
| [indexmap](https://togithub.com/indexmap-rs/indexmap) |
dev-dependencies | minor | `2.2.6` -> `2.3.0` |
| [kstring](https://togithub.com/cobalt-org/kstring) | dependencies |
patch | `2.0.0` -> `2.0.2` |
| [proc-exit](https://togithub.com/rust-cli/proc-exit) | dependencies |
patch | `2.0.1` -> `2.0.2` |
| [serde](https://serde.rs)
([source](https://togithub.com/serde-rs/serde)) | dependencies | patch |
`1.0.203` -> `1.0.204` |
| [serde_json](https://togithub.com/serde-rs/json) | dependencies |
patch | `1.0.119` -> `1.0.121` |
|
[snapbox](https://togithub.com/assert-rs/trycmd/tree/main/crates/snapbox)
([source](https://togithub.com/assert-rs/trycmd)) | dev-dependencies |
patch | `0.6.11` -> `0.6.16` |
| [thiserror](https://togithub.com/dtolnay/thiserror) | dependencies |
patch | `1.0.61` -> `1.0.63` |
| [toml](https://togithub.com/toml-rs/toml) | dependencies | patch |
`0.8.14` -> `0.8.19` |
| [trycmd](https://togithub.com/assert-rs/trycmd) | dev-dependencies |
patch | `0.15.4` -> `0.15.6` |
| [winnow](https://togithub.com/winnow-rs/winnow) | dependencies | patch
| `0.6.13` -> `0.6.18` |

---

### Release Notes

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

###
[`v0.6.15`](https://togithub.com/rust-cli/anstyle/compare/anstream-v0.6.14...anstream-v0.6.15)

[Compare
Source](https://togithub.com/rust-cli/anstyle/compare/anstream-v0.6.14...anstream-v0.6.15)

</details>

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

###
[`v1.1.2`](https://togithub.com/assert-rs/assert_fs/blob/HEAD/CHANGELOG.md#112---2024-07-25)

[Compare
Source](https://togithub.com/assert-rs/assert_fs/compare/v1.1.1...v1.1.2)

##### Compatibility

-   Update MSRV to 1.74.0

</details>

<details>
<summary>BurntSushi/bstr (bstr)</summary>

###
[`v1.10.0`](https://togithub.com/BurntSushi/bstr/compare/1.9.2...1.10.0)

[Compare
Source](https://togithub.com/BurntSushi/bstr/compare/1.9.2...1.10.0)

###
[`v1.9.2`](https://togithub.com/BurntSushi/bstr/compare/1.9.1...1.9.2)

[Compare
Source](https://togithub.com/BurntSushi/bstr/compare/1.9.1...1.9.2)

</details>

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

###
[`v4.5.13`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4513---2024-07-31)

[Compare
Source](https://togithub.com/clap-rs/clap/compare/v4.5.12...v4.5.13)

##### Fixes

- *(derive)* Improve error message when `#[flatten]`ing an optional
`#[group(skip)]`
-   *(help)* Properly wrap long subcommand descriptions in help

###
[`v4.5.12`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4512---2024-07-31)

[Compare
Source](https://togithub.com/clap-rs/clap/compare/v4.5.11...v4.5.12)

###
[`v4.5.11`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4511---2024-07-25)

[Compare
Source](https://togithub.com/clap-rs/clap/compare/v4.5.10...v4.5.11)

###
[`v4.5.10`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#4510---2024-07-23)

[Compare
Source](https://togithub.com/clap-rs/clap/compare/v4.5.9...v4.5.10)

###
[`v4.5.9`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#459---2024-07-09)

[Compare
Source](https://togithub.com/clap-rs/clap/compare/v4.5.8...v4.5.9)

##### Fixes

- *(error)* When defining a custom help flag, be sure to suggest it like
we do the built-in one

</details>

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

###
[`v2.2.1`](https://togithub.com/clap-rs/clap-verbosity-flag/blob/HEAD/CHANGELOG.md#221---2024-07-25)

[Compare
Source](https://togithub.com/clap-rs/clap-verbosity-flag/compare/v2.2.0...v2.2.1)

##### Compatibility

-   Raised MSRV to 1.74

</details>

<details>
<summary>crate-ci/codegenrs (codegenrs)</summary>

###
[`v3.0.2`](https://togithub.com/crate-ci/codegenrs/blob/HEAD/CHANGELOG.md#302---2024-07-25)

[Compare
Source](https://togithub.com/crate-ci/codegenrs/compare/v3.0.1...v3.0.2)

##### Compatibility

-   Update MSRV to 1.74

</details>

<details>
<summary>rust-cli/env_logger (env_logger)</summary>

###
[`v0.11.5`](https://togithub.com/rust-cli/env_logger/blob/HEAD/CHANGELOG.md#0115---2024-07-25)

[Compare
Source](https://togithub.com/rust-cli/env_logger/compare/v0.11.4...v0.11.5)

###
[`v0.11.4`](https://togithub.com/rust-cli/env_logger/blob/HEAD/CHANGELOG.md#0114---2024-07-23)

[Compare
Source](https://togithub.com/rust-cli/env_logger/compare/v0.11.3...v0.11.4)

</details>

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

###
[`v2.0.1`](https://togithub.com/rust-cli/human-panic/blob/HEAD/CHANGELOG.md#201---2024-07-25)

[Compare
Source](https://togithub.com/rust-cli/human-panic/compare/v2.0.0...v2.0.1)

##### Compatibility

-   Update MSV to 1.74

</details>

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

###
[`v2.3.0`](https://togithub.com/indexmap-rs/indexmap/blob/HEAD/RELEASES.md#230)

[Compare
Source](https://togithub.com/indexmap-rs/indexmap/compare/2.2.6...2.3.0)

- Added trait `MutableEntryKey` for opt-in mutable access to map entry
keys.
- Added method `MutableKeys::iter_mut2` for opt-in mutable iteration of
map
    keys and values.

</details>

<details>
<summary>cobalt-org/kstring (kstring)</summary>

###
[`v2.0.2`](https://togithub.com/cobalt-org/kstring/blob/HEAD/CHANGELOG.md#202---2024-07-25)

[Compare
Source](https://togithub.com/cobalt-org/kstring/compare/v2.0.1...v2.0.2)

###
[`v2.0.1`](https://togithub.com/cobalt-org/kstring/blob/HEAD/CHANGELOG.md#201---2024-07-22)

[Compare
Source](https://togithub.com/cobalt-org/kstring/compare/v2.0.0...v2.0.1)

##### Compatibility

-   MSRV is now 1.73

##### Fixes

-   Future-proof unsafe code from things the compiler could do

</details>

<details>
<summary>rust-cli/proc-exit (proc-exit)</summary>

###
[`v2.0.2`](https://togithub.com/rust-cli/proc-exit/blob/HEAD/CHANGELOG.md#202---2024-07-25)

[Compare
Source](https://togithub.com/rust-cli/proc-exit/compare/v2.0.1...v2.0.2)

##### Compatibility

-   Updated MSRV to 1.74

</details>

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

###
[`v1.0.204`](https://togithub.com/serde-rs/serde/releases/tag/v1.0.204)

[Compare
Source](https://togithub.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

- Apply #\[diagnostic::on_unimplemented] attribute on Rust 1.78+ to
suggest adding serde derive or enabling a "serde" feature flag in
dependencies
([#&#8203;2767](https://togithub.com/serde-rs/serde/issues/2767), thanks
[@&#8203;weiznich](https://togithub.com/weiznich))

</details>

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

###
[`v1.0.121`](https://togithub.com/serde-rs/json/releases/tag/v1.0.121)

[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.120...v1.0.121)

- Optimize position search in error path
([#&#8203;1160](https://togithub.com/serde-rs/json/issues/1160), thanks
[@&#8203;purplesyringa](https://togithub.com/purplesyringa))

###
[`v1.0.120`](https://togithub.com/serde-rs/json/releases/tag/v1.0.120)

[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.119...v1.0.120)

- Correctly specify required version of `indexmap` dependency
([#&#8203;1152](https://togithub.com/serde-rs/json/issues/1152), thanks
[@&#8203;cforycki](https://togithub.com/cforycki))

</details>

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

###
[`v0.6.16`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.15...snapbox-v0.6.16)

[Compare
Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.15...snapbox-v0.6.16)

###
[`v0.6.15`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.14...snapbox-v0.6.15)

[Compare
Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.14...snapbox-v0.6.15)

###
[`v0.6.14`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.13...snapbox-v0.6.14)

[Compare
Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.13...snapbox-v0.6.14)

###
[`v0.6.13`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.12...snapbox-v0.6.13)

[Compare
Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.12...snapbox-v0.6.13)

###
[`v0.6.12`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.11...snapbox-v0.6.12)

[Compare
Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.11...snapbox-v0.6.12)

</details>

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

###
[`v1.0.63`](https://togithub.com/dtolnay/thiserror/releases/tag/1.0.63)

[Compare
Source](https://togithub.com/dtolnay/thiserror/compare/1.0.62...1.0.63)

-   Documentation improvements

###
[`v1.0.62`](https://togithub.com/dtolnay/thiserror/releases/tag/1.0.62)

[Compare
Source](https://togithub.com/dtolnay/thiserror/compare/1.0.61...1.0.62)

- Support referring to nested tuple struct fields inside `#[error("…",
…)]` attribute
([#&#8203;309](https://togithub.com/dtolnay/thiserror/issues/309))

</details>

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

###
[`v0.8.19`](https://togithub.com/toml-rs/toml/compare/toml-v0.8.18...toml-v0.8.19)

[Compare
Source](https://togithub.com/toml-rs/toml/compare/toml-v0.8.18...toml-v0.8.19)

###
[`v0.8.18`](https://togithub.com/toml-rs/toml/compare/toml-v0.8.17...toml-v0.8.18)

[Compare
Source](https://togithub.com/toml-rs/toml/compare/toml-v0.8.17...toml-v0.8.18)

###
[`v0.8.17`](https://togithub.com/toml-rs/toml/compare/toml-v0.8.16...toml-v0.8.17)

[Compare
Source](https://togithub.com/toml-rs/toml/compare/toml-v0.8.16...toml-v0.8.17)

###
[`v0.8.16`](https://togithub.com/toml-rs/toml/compare/toml-v0.8.15...toml-v0.8.16)

[Compare
Source](https://togithub.com/toml-rs/toml/compare/toml-v0.8.15...toml-v0.8.16)

###
[`v0.8.15`](https://togithub.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15)

[Compare
Source](https://togithub.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15)

</details>

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

###
[`v0.6.18`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0618---2024-07-31)

[Compare
Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.17...v0.6.18)

###
[`v0.6.17`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0617---2024-07-31)

[Compare
Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.16...v0.6.17)

##### Features

-   Make `Checkpoint`s comparable

###
[`v0.6.16`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0616---2024-07-25)

[Compare
Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.15...v0.6.16)

###
[`v0.6.15`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0615---2024-07-22)

[Compare
Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.14...v0.6.15)

##### Compatibility

-   Deprecated `Parser::recognize` in favor of `Parser::take`
-   Deprecated `Parser::with_recognized` in favor of `Parser::taken`

##### Fixes

- Renamed `Parser::recognize` to `Parser::take` to be consistent with
other `take` parsers
- Renamed `Parser::with_recognized` to `Parser::with_taken` to be
consistent with other `take` parsers

###
[`v0.6.14`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0614---2024-07-19)

[Compare
Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.13...v0.6.14)

##### Fixes

-   Removed unused `I: Clone` bound on `Parser::parse`

</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://togithub.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://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/crate-ci/typos).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-01 01:43:39 +00:00
.cargo chore: Don't set rustflags by default 2023-03-29 14:46:23 -05:00
.github chore(deps): Update Rust Stable to v1.80 (#1064) 2024-07-26 23:58:00 +00:00
action chore: Release 2024-07-31 11:42:59 -05:00
benchsuite test: Fix typo 2021-10-25 10:29:37 -05:00
crates chore: Release 2024-07-31 11:42:59 -05:00
docs chore: Release 2024-07-31 11:42:59 -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 Add "--force-exclude" option 2023-10-09 19:39:11 +00:00
action.yml fix(action): Don't require sudo 2023-05-22 13:30:04 -05:00
Cargo.lock chore(deps): Update compatible (#1071) 2024-08-01 01:43:39 +00:00
Cargo.toml chore: Update from _rust/main template 2024-07-26 16:07:19 -05:00
CHANGELOG.md chore: Release 2024-07-31 11:42:59 -05:00
committed.toml chore: First step 2023-03-29 14:33:22 -05:00
CONTRIBUTING.md chore: Update from _rust/main template 2024-07-26 16:07:19 -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 chore: First step 2023-03-29 14:33:22 -05: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-07-31 11:42:59 -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.