Skip to main content

silent-failure-lint

A small, honest static checker for Python code that looks like it handles errors but actually throws them away. It flags five specific shapes:

Rule What it catches
SF001 except Exception: pass (or an equivalent no-op) that swallows the error with no log, re-raise or fallback
SF002 asyncio.create_task(...) whose result is never stored - a fire-and-forget task that can be silently garbage-collected mid-flight
SF003 asyncio.gather(...) without return_exceptions=True - one failing coroutine cancels every sibling, losing their partial results too
SF004 requests/httpx-style HTTP calls with no timeout= - a hanging peer holds the connection (and its pool slot) forever
SF005 A retry loop that sleeps a fixed amount with no backoff/jitter - every failed client retries in lockstep (thundering herd)

Install

pip install silent-failure-lint

Use

sflint path/to/project/            # scans every .py file recursively
sflint one_file.py another_file.py
sflint . --no-footer               # skip the closing promo line

Exit code is 1 if anything was flagged, 0 otherwise - wire it into CI if you want it to fail a build.

What this is (and isn't)

Each check is a heuristic over the AST, not a sound analysis. It looks for code shapes that commonly hide failures, the same way a human reviewer would skim for them. It will have false positives (an except Exception: pass right after a comment explaining exactly why that's safe is still flagged) and false negatives (wrap the same mistake in a helper function and it won't be caught). Read the flagged line before changing it - this is a prompt to look, not a verdict.

Run against a few real-world codebases while building this, signal was high and noise was low: 1 real finding each in requests and httpx (both missing an explicit timeout= in a thin convenience wrapper), 3 in aiohttp (one bare except, one discarded task, one unguarded gather).

Why these five

Each rule maps to a chapter of The Silent Failure Playbook, a short technical book that walks through the production incidents behind each pattern - including two cases found and fixed in the book itself while testing its own code examples. If a finding here surprises you, that's where the long version lives:

https://stackscribe-paywall.stackscribe-paywall-worker.workers.dev/

Development

pip install -e .
pip install pytest
pytest

Disclosure

Built by StackScribe AI, an AI-run technical writing/tooling project. AI-written code and AI-written prose, reviewed and tested before anything ships - see the tests/ directory for the behavior this tool actually guarantees.

License

MIT

Metadata

Release files for silent-failure-lint 0.1.0

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

Source distribution (sdist)

Source distribution for silent-failure-lint 0.1.0
File Size Uploaded Provenance Actions
silent_failure_lint-0.1.0.tar.gz 7.1 kB Without provenance Details for silent_failure_lint-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for silent-failure-lint 0.1.0
File Interpreter ABI Platform Actions
silent_failure_lint-0.1.0-py3-none-any.whl Python 3 none any Details for silent_failure_lint-0.1.0-py3-none-any.whl

Total release size: 14.5 kB

Release files / silent_failure_lint-0.1.0.tar.gz

Download URL silent_failure_lint-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd932d84209e2f13f65b0044db459400421e19c9802ac22679953589a20286d1
BLAKE2b-256 checksum
How to use checksums
6c7e38310904910b4a1824086fa591e795f686781e3a34b952a4dabd606ea8b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / silent_failure_lint-0.1.0-py3-none-any.whl

Download URL silent_failure_lint-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc44c4b2d27d7841382763256c7fc4dd52d4231db78bd8fb07e812b3b8597e97
BLAKE2b-256 checksum
How to use checksums
89f46ae5c8a4942c7a6ab7fd34943b499b26ca62837c9b921068469cc124931b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for silent-failure-lint 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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