Plugin API (v1)¶
DevRepro Doctor is extensible via Python entry points. The plugin API is
versioned: devrepro.plugins.loader.API_VERSION is currently "1". Breaking
changes bump the major version and are announced in CHANGELOG.md.
Entry-point groups¶
| Group | Contract |
|---|---|
devrepro.probes |
A class with id, version, platforms, run(ctx) -> ProbeResult |
devrepro.rules |
A callable (RuleContext) -> Iterable[Finding] |
devrepro.remediations |
A callable (list[Finding]) -> list[Remediation] |
devrepro.project_detectors |
A callable (Path) -> list[ProjectRequirement] |
devrepro.exporters |
A class with export(content: str, filename: str) -> str |
Example¶
# your plugin's pyproject.toml
[project.entry-points."devrepro.probes"]
myprobe = "myprobe.probe:MyProbe"
Testing your plugin¶
- Build a
RecordingRunner(devrepro.core.runner) with cannedCommandResults — never depend on the developer's real machine. - Assert your probe returns
ProbeResultwith at least oneFindingcarryingEvidence(findings without evidence are invalid). - Run your plugin against
devrepro self-testin CI to catch API drift.
Rules for plugin authors¶
- Probes must be read-only and time-bounded (
timeout_seconds). - Never raise out of
run(); return aProbeResultwitherrorset. - Redact personal paths before placing them in
Evidence.excerpt.