Reports

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.

Terminal (default)

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

--json prints the full structured report. Top-level keys:

KeyContents
root_dirThe analysis root directory.
summarytotal_files, reachable_files, findings, by_rule, by_confidence.
findingsObjects with rule, confidence, message, file, line, column, and extra (rule-specific metadata like the unused name).
modulesPer-module records: path, module_name, is_package, is_entry, exports, imports, reachable.
entry_pointsModule names treated as entries.
cyclesDetected import cycles (empty unless --cycles).
depsReserved 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

--sarif emits a SARIF 2.1.0 document for Code Scanning tools:

pragyalint --sarif > pragyalint.sarif

Combine with the GitHub Code Scanning upload action to surface findings in pull requests — see CI / automation.

A note on --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.