PragyaLint runs five independent rules. Each finding is tagged with
the rule that produced it, so you can filter with
--rules or read rule in JSON output.
| Rule | Checks | Confidence |
|---|---|---|
unused_file |
Module unreachable from any entry point. | high |
unused_import |
An imported name (or a single name inside a multi-name import) never referenced in that file. | high |
unused_export |
A top-level function/class/variable no other module ever imports. | medium (or low if dynamic dispatch detected) |
unused_local |
A top-level definition referenced nowhere in the project at all — not even within its own file. | medium (or low if dynamic dispatch detected) |
cycle |
A circular import between modules (only run with --cycles). |
low |
These two look similar but check different things, and a definition can trigger one, both, or neither:
unused_export asks: does any other module import
this? A function only ever called from within its own file
(a private helper, effectively) will trigger this even though it's
perfectly alive.
unused_local asks: is this referenced anywhere at
all, including its own file? This is the stronger claim — a
unused_local finding means the definition is
genuinely never called.
_ (treated as intentionally private).__all__.getattr(obj, "literal_name") anywhere in the project.--include-entry-exports is passed.# pragyalint: keep comment.# Only check for unused files and imports (fastest, highest-confidence pass)
pragyalint --rules unused_file unused_import
# Add cycle detection (off by default)
pragyalint --cycles