Skip to main content

typos-pants-plugin

PyPI Version

A Pantsbuild plugin that checks and corrects spelling in source code with typos, the Rust-based spell checker built for code.

Installation

Add the plugin to pants.toml:

[GLOBAL]
plugins = ["typos-pants-plugin==<version>"]

Then run typos through the lint and fix goals:

pants lint ::   # report every typo
pants fix ::    # write the unambiguous corrections back

How it works

typos is downloaded as a static binary; nothing is installed into a Pants resolve. The plugin registers two goal integrations that share one process setup:

  • pants lint runs typos in check mode and reports every typo it finds, including misspelled file names and typos with several candidate corrections. The linter fails when typos does.
  • pants fix runs typos --write-changes and writes the corrected files back to the workspace. typos only corrects typos with a single candidate, and the plugin passes --no-check-filenames because Pants cannot write a rename back: whatever fix leaves behind, lint still reports.

For each run Pants:

  1. Selects the files the goal was given that match [typos].glob_pattern (every file by default).
  2. Includes every config file typos would discover for those files (see below).
  3. Runs typos once per batch with --force-exclude, so the files.extend-exclude globs of your config apply even though Pants lists the files explicitly.

lint does not reuse the fix result (the usual Pants pattern for fixers): diffing a fix run would miss the ambiguous typos and the misspelled file names that typos reports but cannot correct.

Configuration

typos reads typos.toml, _typos.toml or .typos.toml, the [tool.typos] table of pyproject.toml, or the [workspace.metadata.typos] / [package.metadata.typos] tables of Cargo.toml, from each checked file's directory and its ancestors. Pants includes those files automatically. Point [typos].config at a config file elsewhere to use that file alone.

Option Default Purpose
[typos].skip false Skip typos during pants lint and pants fix.
[typos].args [] Extra arguments for typos, e.g. --locale en-us or --format brief.
[typos].config unset Path to a typos config file. Disables discovery and runs typos with --isolated.
[typos].config_discovery true Include the config files typos discovers. When false, typos runs with --isolated.
[typos].glob_pattern ["**/*"] Globs selecting the files to check; a leading ! excludes.
[typos].version bundled default typos release to download.
[typos].known_versions bundled default Checksums of downloadable releases; extend to use another version.

With --isolated, typos ignores config files it would otherwise find on its own, including a pyproject.toml file that is itself among the files being checked.

Using a different typos version

Add the release's checksums and sizes to known_versions and set version:

[typos]
version = "1.52.0"
known_versions.add = [
  "1.52.0|linux_arm64 |<sha256>|<size>",
  "1.52.0|linux_x86_64|<sha256>|<size>",
  "1.52.0|macos_arm64 |<sha256>|<size>",
  "1.52.0|macos_x86_64|<sha256>|<size>",
]

Compute each line with curl -L $URL | tee >(wc -c) >(shasum -a 256) >/dev/null, where $URL is the typos-v<version>-<target>.tar.gz asset of the GitHub release.

Supported versions

Plugin Pants Python typos
0.x 2.33 3.14 >=1.16.18,<2

Pants loads plugins into its own interpreter, so the plugin requires the Python version Pants runs on. The files being checked can be anything typos understands.

Releases

Wheels are published to PyPI. Release notes live in the changelog and on the GitHub releases page.

Contributing, Bug Reports and Feature Requests

This plugin lives in the pants-plugin-depot repo. See its CONTRIBUTING.md, or open an issue.

Metadata

Release files for typos-pants-plugin 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for typos-pants-plugin 0.1.3
File Interpreter ABI Platform Actions
typos_pants_plugin-0.1.3-py3-none-any.whl Python 3 none any Details for typos_pants_plugin-0.1.3-py3-none-any.whl

Release files / typos_pants_plugin-0.1.3-py3-none-any.whl

Download URL typos_pants_plugin-0.1.3-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b475c6d1067e1a4e1f5cf64e5ea33fb3aafb8f8017167bd546a34046993f444c
BLAKE2b-256 checksum
How to use checksums
c5ef6dd2e2d21add8f52283e13b766bebf1e30ba7f96e8d102a06a5cf60a9a24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for typos-pants-plugin 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for typos_pants_plugin-0.1.3-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page