Skip to main content

Deterministic linter for overlong and duplicated prose in Python comments and docstrings.

Project description

tooprolix

Less narration. More signal.
Deterministic control over comments and docstrings in Python repositories.

PyPI Python Powered by Rust

Coding agents over-explain. Comments grow into essays, docstrings restate the code, and the same rationale quietly spreads across five files. tooprolix turns that into TPX diagnostics you can act on. It reads only comments and docstrings, never rewrites your why, and leaves the call to you.

Quick start

Run tooprolix without installing it with uv:

$ uvx tooprolix check .
src/config.py:1-26: TPX002 docstring is 243 words long, over the 200-word limit — shorten it, or mark it with `# !TPX002` on the line above it
Found 1 findings (TPX002: 1).

Each finding points to path:start-end, so you know how big the block is before you open it.

For an existing uv project, pin the tool as a development dependency and run it through uv:

$ uv add --dev tooprolix
$ uv run tooprolix check .

And when the whole tree came back clean:

$ uvx tooprolix check .
All checks passed!

Exit codes are the contract: 0 clean, 1 findings, 2 could not start. A tree that was not read whole never exits 0. See the CLI contract.

Rules at a glance

Code Detects Status
TPX001 A comment run longer than its word limit Released
TPX002 A docstring longer than its word limit Released
TPX003 One explanation repeated across comments and docstrings, reported once with every place it appears Released
TPX004 Comments that restate the following code Reserved

tooprolix --rules prints this table; tooprolix --version prints the version and the date of the commit it was built from.

Some prose earns its length. Put a marker on the line directly above the block:

# !TPX003
# The retry contract is restated here on purpose, so this module can be read on
# its own without opening the client it talks to.

Several codes, blanket suppression, and repository-wide config live in rules and configuration.

Validation

Rules are exercised on six pinned real repositories agent frameworks and mature libraries not only synthetic fixtures. Every threshold is read off that corpus rather than chosen by taste, and critical guards are mutation-proved: a test that stays green when its guarantee is broken is deleted, not kept for the count.

Why tooprolix

  • Repository-wide. It finds one explanation repeated across otherwise unrelated files.
  • Deterministic. The same source produces the same ordered findings, byte for byte.
  • Local. No model calls, no network, no probabilistic output.

Documentation

CLI and exit-code contract Addresses, output channels, colour, exit codes, JSON schema
Rules and configuration Thresholds, suppression markers, pyproject.toml
corpus/REPORT.md The corpus, the measurements, the open questions
CONTRIBUTING.md Toolchain, gates, commit and release conventions

Contributing

Run make help for the task list, and see CONTRIBUTING.md for the toolchain and the gates CI requires.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tooprolix-0.5.4.tar.gz (477.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tooprolix-0.5.4-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

tooprolix-0.5.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tooprolix-0.5.4-py3-none-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file tooprolix-0.5.4.tar.gz.

File metadata

  • Download URL: tooprolix-0.5.4.tar.gz
  • Upload date:
  • Size: 477.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tooprolix-0.5.4.tar.gz
Algorithm Hash digest
SHA256 d3407dedc9bc1ca9be4f57e0dea3e7ebd64e3887728230a9974a944f2e36f050
MD5 9cf91ab840c4f266e3aef8421e142505
BLAKE2b-256 fc902c089a0f45975d36747ba6fbcdc2e8b5d9c06280c426c5860ec735b5e078

See more details on using hashes here.

Provenance

The following attestation bundles were made for tooprolix-0.5.4.tar.gz:

Publisher: build-artifacts.yml on golyshevskii/tooprolix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tooprolix-0.5.4-py3-none-win_amd64.whl.

File metadata

  • Download URL: tooprolix-0.5.4-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tooprolix-0.5.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cc40d82eb781e56f9da6ca601feb61d68b59fbce2570693bb81daa02b0a43b2c
MD5 2a5790e8e38edd417737475106345ae5
BLAKE2b-256 1cc306da7a209883340709c265c1f01813675e61655d39a1f43e7f3ebf4514c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tooprolix-0.5.4-py3-none-win_amd64.whl:

Publisher: build-artifacts.yml on golyshevskii/tooprolix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tooprolix-0.5.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tooprolix-0.5.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 319ef15c743cf179cc608a6c31dc691145cb7b139f710eded9b6b1d85f2128f8
MD5 4f18a54fcc163e94633bbd8b67c3e74c
BLAKE2b-256 6cbf87b81910a9169efe27a99a227305ef759266e1008f7456471105bf66ed8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tooprolix-0.5.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build-artifacts.yml on golyshevskii/tooprolix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tooprolix-0.5.4-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tooprolix-0.5.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ae748ea9d134c89eff3bd3152eabdc9c4966953509e6f46f3eb45a85fa38ceb
MD5 3854a0dc9faa45148a0264f9d74759bc
BLAKE2b-256 43a5f4e25e0960265a4e051572e740972cc3d5ec9103e6cad1287f0292ef4721

See more details on using hashes here.

Provenance

The following attestation bundles were made for tooprolix-0.5.4-py3-none-macosx_11_0_arm64.whl:

Publisher: build-artifacts.yml on golyshevskii/tooprolix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page