(
plugin_dir: Path, config: EvalConfig, output_dir: Path
)
| 110 | |
| 111 | |
| 112 | def evaluate_one( |
| 113 | plugin_dir: Path, config: EvalConfig, output_dir: Path |
| 114 | ) -> PluginRow: |
| 115 | start = time.monotonic() |
| 116 | name = plugin_dir.name |
| 117 | engine = EvalEngine(config) |
| 118 | try: |
| 119 | result = engine.evaluate_plugin(plugin_dir) |
| 120 | except Exception as exc: |
| 121 | return PluginRow( |
| 122 | name=name, |
| 123 | score=None, |
| 124 | badge=None, |
| 125 | confidence=None, |
| 126 | ci_lower=None, |
| 127 | ci_upper=None, |
| 128 | anti_patterns=[], |
| 129 | weakest_dimensions=[], |
| 130 | duration_ms=int((time.monotonic() - start) * 1000), |
| 131 | errored=True, |
| 132 | error=f"{type(exc).__name__}: {exc}", |
| 133 | ) |
| 134 | |
| 135 | duration_ms = int((time.monotonic() - start) * 1000) |
| 136 | (output_dir / f"{name}.json").write_text(result.model_dump_json(indent=2)) |
| 137 | return row_from_result(name, result, duration_ms) |
| 138 | |
| 139 | |
| 140 | def format_score(v: float | None) -> str: |
no test coverage detected