PragyaLint's findings render three ways: human-readable terminal
output by default, JSON with --json, and SARIF with
--sarif. Pick one per run — JSON and SARIF are
mutually exclusive output modes.
Findings are grouped by file, each with a location, a confidence marker, and a message:
$ pragyalint
./src/orphan.py
✘ [HIGH ] module 'orphan' is not reachable from any entry point
./src/utils/helper.py
⚠ [MEDIUM] export 'legacy_fn' of module 'utils.helper' is never imported
./src/app.py
✘ [HIGH ] import 'os' is never used
3 findings in 12 files (11 reachable).
2 high | 1 medium
Markers and colors by confidence:
✘ (✖)⚠ (⚠)ℹ (ℹ)
Pass --no-color to disable ANSI colors (useful for logs
and diffs). When there's nothing to report, PragyaLint prints
No dead code found.
--json prints the full structured report. Top-level keys:
| Key | Contents |
|---|---|
root_dir | The analysis root directory. |
summary | total_files, reachable_files, findings, by_rule, by_confidence. |
findings | Objects with rule, confidence, message, file, line, column, and extra (rule-specific metadata like the unused name). |
modules | Per-module records: path, module_name, is_package, is_entry, exports, imports, reachable. |
entry_points | Module names treated as entries. |
cycles | Detected import cycles (empty unless --cycles). |
deps | Reserved dependency map. |
pragyalint --json
Truncated example:
{
"root_dir": "/home/you/project",
"summary": {
"total_files": 12,
"reachable_files": 11,
"findings": 2,
"by_rule": {"unused_file": 1, "unused_import": 1},
"by_confidence": {"high": 2}
},
"findings": [
{
"rule": "unused_file",
"confidence": "high",
"message": "module 'orphan' is not reachable from any entry point",
"file": "/home/you/project/src/orphan.py",
"line": null,
"column": null,
"extra": {"module": "orphan"}
}
],
"entry_points": ["main"],
"cycles": []
}
Feed it to jq for quick triage:
pragyalint --json | jq -r '.findings[] | [.rule, .confidence, (.file | split("/") | last)] | @tsv'
--sarif emits a SARIF 2.1.0 document for Code Scanning tools:
pragyalint --sarif > pragyalint.sarif
error, medium → warning, low → note.runs[0].tool.driver.Combine with the GitHub Code Scanning upload action to surface findings in pull requests — see CI / automation.
--fix alongside reports
Fixes run as their own pass. With --dry-run the plan is
printed first, then the report follows; nothing is written to disk.
See Fixes & --fix.