ac7cfe7515
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [clap](https://togithub.com/clap-rs/clap) | dependencies | patch | `4.5.4` -> `4.5.8` | | [derive_more](https://togithub.com/JelteF/derive_more) | dependencies | patch | `0.99.17` -> `0.99.18` | | [edit-distance](https://togithub.com/febeling/edit-distance) | dev-dependencies | patch | `2.1.0` -> `2.1.2` | | [enumflags2](https://togithub.com/meithecatte/enumflags2) | dependencies | patch | `0.7.9` -> `0.7.10` | | [log](https://togithub.com/rust-lang/log) | dependencies | patch | `0.4.21` -> `0.4.22` | | [regex](https://togithub.com/rust-lang/regex) | dependencies | patch | `1.10.4` -> `1.10.5` | | [regex](https://togithub.com/rust-lang/regex) | dev-dependencies | patch | `1.10.4` -> `1.10.5` | | [serde_json](https://togithub.com/serde-rs/json) | dependencies | patch | `1.0.117` -> `1.0.119` | | [snapbox](https://togithub.com/assert-rs/trycmd/tree/main/crates/snapbox) ([source](https://togithub.com/assert-rs/trycmd)) | dev-dependencies | patch | `0.6.7` -> `0.6.10` | | [toml](https://togithub.com/toml-rs/toml) | dependencies | patch | `0.8.13` -> `0.8.14` | | [unicode-width](https://togithub.com/unicode-rs/unicode-width) | dependencies | patch | `0.1.12` -> `0.1.13` | | [winnow](https://togithub.com/winnow-rs/winnow) | dependencies | patch | `0.6.9` -> `0.6.13` | --- ### Release Notes <details> <summary>clap-rs/clap (clap)</summary> ### [`v4.5.8`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#458---2024-06-28) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.7...v4.5.8) ##### Fixes - Reduce extra flushes ### [`v4.5.7`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#457---2024-06-10) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.6...v4.5.7) ##### Fixes - Clean up error message when too few arguments for `num_args` ### [`v4.5.6`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#456---2024-06-06) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.5...v4.5.6) ### [`v4.5.5`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#455---2024-06-06) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.4...v4.5.5) ##### Fixes - Allow `exclusive` to override `required_unless_present`, `required_unless_present_any`, `required_unless_present_all` </details> <details> <summary>JelteF/derive_more (derive_more)</summary> ### [`v0.99.18`](https://togithub.com/JelteF/derive_more/compare/v0.99.17...v0.99.18) [Compare Source](https://togithub.com/JelteF/derive_more/compare/v0.99.17...v0.99.18) </details> <details> <summary>febeling/edit-distance (edit-distance)</summary> ### [`v2.1.2`](https://togithub.com/febeling/edit-distance/compare/2.1.1...2.1.2) [Compare Source](https://togithub.com/febeling/edit-distance/compare/2.1.1...2.1.2) </details> <details> <summary>meithecatte/enumflags2 (enumflags2)</summary> ### [`v0.7.10`](https://togithub.com/meithecatte/enumflags2/releases/tag/v0.7.10): Release 0.7.10 [Compare Source](https://togithub.com/meithecatte/enumflags2/compare/v0.7.9...v0.7.10) - Fix a case where the `#[bitflags]` macro would access the crate through `enumflags2::...` instead of `::enumflags2::...`. This makes the generated code more robust and avoids triggering the `unused_qualifications` lint. ([#​58](https://togithub.com/meithecatte/enumflags2/issues/58)) - Rework the proc-macro to use `syn` with the `derive` feature (as opposed to `full`). This reduces the `cargo build` time for `enumflags2` by about 20%. </details> <details> <summary>rust-lang/log (log)</summary> ### [`v0.4.22`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0422---2024-06-27) [Compare Source](https://togithub.com/rust-lang/log/compare/0.4.21...0.4.22) </details> <details> <summary>rust-lang/regex (regex)</summary> ### [`v1.10.5`](https://togithub.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#1105-2024-06-09) [Compare Source](https://togithub.com/rust-lang/regex/compare/1.10.4...1.10.5) \=================== This is a new patch release with some minor fixes. Bug fixes: - [BUG #​1203](https://togithub.com/rust-lang/regex/pull/1203): Escape invalid UTF-8 when in the `Debug` impl of `regex::bytes::Match`. </details> <details> <summary>serde-rs/json (serde_json)</summary> ### [`v1.0.119`](https://togithub.com/serde-rs/json/releases/tag/v1.0.119) [Compare Source](https://togithub.com/serde-rs/json/compare/v1.0.118...v1.0.119) - Add `serde_json::Map::shift_insert` ([#​1149](https://togithub.com/serde-rs/json/issues/1149), thanks [@​joshka](https://togithub.com/joshka)) ### [`v1.0.118`](https://togithub.com/serde-rs/json/releases/tag/v1.0.118) [Compare Source](https://togithub.com/serde-rs/json/compare/v1.0.117...v1.0.118) - Implement Hash for serde_json::Value ([#​1127](https://togithub.com/serde-rs/json/issues/1127), thanks [@​edwardycl](https://togithub.com/edwardycl)) </details> <details> <summary>assert-rs/trycmd (snapbox)</summary> ### [`v0.6.10`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.9...snapbox-v0.6.10) [Compare Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.9...snapbox-v0.6.10) ### [`v0.6.9`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.8...snapbox-v0.6.9) [Compare Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.8...snapbox-v0.6.9) ### [`v0.6.8`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.7...snapbox-v0.6.8) [Compare Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.6.7...snapbox-v0.6.8) </details> <details> <summary>toml-rs/toml (toml)</summary> ### [`v0.8.14`](https://togithub.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14) [Compare Source](https://togithub.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14) </details> <details> <summary>unicode-rs/unicode-width (unicode-width)</summary> ### [`v0.1.13`](https://togithub.com/unicode-rs/unicode-width/compare/v0.1.12...v0.1.13) [Compare Source](https://togithub.com/unicode-rs/unicode-width/compare/v0.1.12...v0.1.13) </details> <details> <summary>winnow-rs/winnow (winnow)</summary> ### [`v0.6.13`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0613---2024-06-06) [Compare Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.12...v0.6.13) ##### Documentation - Expand on error reporting ### [`v0.6.12`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0612---2024-06-06) [Compare Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.11...v0.6.12) ##### Fixes - Improve compilation errors when using non-parsers with `seq!` struct syntax ### [`v0.6.11`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0611---2024-06-03) [Compare Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.10...v0.6.11) ##### Fixes - Remove `AsBytes` bounds, unblocking parsing frames of binary input ### [`v0.6.10`](https://togithub.com/winnow-rs/winnow/blob/HEAD/CHANGELOG.md#0610---2024-06-03) [Compare Source](https://togithub.com/winnow-rs/winnow/compare/v0.6.9...v0.6.10) ##### Features - Extend `seq!` to constructing enum variants </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 has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/crate-ci/typos). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
---|---|---|
.cargo | ||
.github | ||
action | ||
benchsuite | ||
crates | ||
docs | ||
.clippy.toml | ||
.dockerignore | ||
.gitignore | ||
.ignore | ||
.pre-commit-config.yaml | ||
.pre-commit-hooks.yaml | ||
action.yml | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
committed.toml | ||
CONTRIBUTING.md | ||
deny.toml | ||
Dockerfile | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
release.toml | ||
setup.py |
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
Dual-licensed under MIT or Apache 2.0
Documentation
- Installation
- Getting Started
- Reference
- FAQ
- Comparison with other spell checkers
- Projects using typos
- Benchmarks
- Design
- Contribute
- CHANGELOG
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
- GitHub Actions
- pre-commit
- 🐊Putout Processor
- Visual Studio Code
- typos-lsp (Language Server Protocol server)
Custom
typos
provides several building blocks for custom native integrations
-
reads fromstdin
,--write-changes
will be written tostdout
--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.
- To correct it locally, see also our False Positives documentation.
- To contribute your correction, see Contribute