Skip to main content

tingle

Spider-sense for refactoring: you know that tingle — the itch that says the codebase isn't right yet. This tool puts a number on it, so you can watch it drop.

Code metrics for the era of constant refactoring.

tingle measures things you want to shrink (or watch) while refactoring a codebase: ignored lint rules, inline # noqa / # type: ignore comments, uses of a legacy class during a strangler-fig migration, lines of code in a package that should disappear.

It runs once, prints the numbers, and stores nothing — pipe the JSON into whatever tracks history for you (CI artifacts, dashboards, a spreadsheet).

📖 Documentation: https://fancysnake.github.io/tingle/

Install

$ pip install tingle

Quick start

$ tingle init                                    # starter tingle.toml
$ tingle add regex_count '#\s*noqa'              # add a metric from the CLI
$ tingle add toml_list_length tool.ruff.lint.ignore --name ruff-ignores
$ tingle                                         # interactive mode (on a terminal)
$ tingle stat                                    # summary table
$ tingle stat --json                             # machine-readable output
$ tingle stat --diff                             # impact of the current branch
$ tingle report                                  # every occurrence, file:line
$ tingle report --diff                           # what the branch added/removed

Metrics are declared in tingle.toml (or a [tool.tingle] section in pyproject.toml):

[ranges.python]
include = ["src/**/*.py", "tests/**/*.py"]
default = true

[[metrics]]
name = "noqa-comments"
type = "regex_count"
pattern = '#\s*noqa'

You can count regex matches, uses of a Python symbol, entries in a TOML or INI list (this is how you count ignored lint rules), files, and lines. See the metric types.

What it does

Three things, in rising order of opinion:

  • Measure. tingle stat counts what you told it to count and prints the numbers. Metric values never affect the exit code — tingle measures, it does not judge.
  • Attribute. tingle stat --diff measures only what the current branch changed, against the merge-base with a base branch, so commits that landed on the base after you branched don't pollute your numbers.
  • Judge. tingle check is the CI gate: the same branch measurement, but it exits 1 if the branch made things worse, so a pull request that takes on debt fails the build.
$ tingle check
noqa-comment (regex_count): +2
  + src/api/views.py:23
  + src/api/views.py:41

$ echo $?
1

Documentation

Development

Python 3.11–3.14 are supported (CI runs the full matrix). The project uses mise + Poetry.

$ mise install
$ poetry install
$ mise run test:py      # tests
$ mise run lint:py      # ruff, mypy, pylint, import-linter
$ mise run docs:serve   # preview the docs site

See contributing for the GLIMPSE source layout and the layer contracts.

License

MIT.

Release files for tingle 0.4.1

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

Source distribution (sdist)

Source distribution for tingle 0.4.1
File Size Uploaded
tingle-0.4.1.tar.gz 52.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tingle 0.4.1
File Interpreter ABI Platform
tingle-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 121.1 kB

Release files / tingle-0.4.1.tar.gz

Download URL tingle-0.4.1.tar.gz
Size 52.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7ce04d7fffaae21c930efcb85e9e168366125d6bedd3850ac66e33bb99216098
BLAKE2b-256 checksum
How to use checksums
b4941e4c504c8aede3206076b3462841b3414f009fb6355f343e6c9eb214be9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Aug 9, 2026.

Transparency log

Release files / tingle-0.4.1-py3-none-any.whl

Download URL tingle-0.4.1-py3-none-any.whl
Size 68.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae1c281a8fa62725af8dfb3aebc22b6db06efc1e17df2ce7316e09017a8b4998
BLAKE2b-256 checksum
How to use checksums
1044280ceb30d4d68f3b99ef83e68327f9ff4995f68d061b4a2c8bd41c96b9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Aug 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.1.0

2 release files

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