Contributing

PragyaLint is a small, dependency-free codebase — the analysis engine, the fixer, and the finders all live in one package with a tidy test suite. Here's how to get set up and what the maintainers expect.

Dev setup

git clone https://github.com/Sanskriti-Studios/PragyaLint
cd PragyaLint
python -m venv .venv
source .venv/bin/activate               # Linux/macOS
.venv\Scripts\activate                  # Windows (cmd)
.venv\Scripts\Activate.ps1              # Windows (PowerShell)
pip install -e ".[dev]"
pytest -q

Requires Python 3.11 or newer. The dev extra is just pytest — the package itself stays zero-dependency.

Repository layout

PathWhat it's for
pragyalint/The package.
pragyalint/analyzer.pyPipeline: graph, reachability, then finder passes.
pragyalint/graph.pyDiscovery, AST parsing, imports/exports, cycle detection.
pragyalint/finders/One file per rule (unused_*, cycles).
pragyalint/fixer.pyOpt-in, confidence-gated edits.
pragyalint/reporters/Terminal, JSON, and SARIF formatting.
pragyalint/dynamic.pyDynamic-dispatch heuristics and the keep pragma.
pragyalint/config.pyConfig discovery and defaults.
tests/pytest suite — one module per area (test_graph, test_exports, test_fixer, …).
site/This static documentation site.
extensions/vscode-pragyalint/VS Code extension source.

Running & adding tests

pytest -q                         # whole suite
pytest tests/test_graph.py        # a single module
pytest -k "exports or dynamic"    # by keyword

New rules or behaviors need tests that build a tiny fixture tree in a temp directory and assert on the emitted findings — follow the existing test style. The repo's CI gate also runs a self-analysis:

pragyalint --fail-on high --include pragyalint

CI workflows

WorkflowRuns
tests.ymlpytest on Python 3.11/3.12/3.13 plus the self-analysis gate, on push and PR.
pages.ymlDeploys site/ to GitHub Pages on push to main.
publish.ymlBuilds and publishes to PyPI and GitHub Releases; triggers on a release: commit.
bins.ymlBuilds standalone Windows/Linux/macOS binaries with PyInstaller and attaches them to releases.

Conventions

Opening a PR

Issues and PRs: github.com/Sanskriti-Studios/PragyaLint/issues