Compare Rust-supported checker output against the Python oracle.
(
python_results: dict[str, CheckerResults],
files: list[str] | None,
)
| 157 | |
| 158 | |
| 159 | def run_rust_ab_check( |
| 160 | python_results: dict[str, CheckerResults], |
| 161 | files: list[str] | None, |
| 162 | ) -> bool: |
| 163 | """Compare Rust-supported checker output against the Python oracle.""" |
| 164 | rust_results = run_rust_linter(files) |
| 165 | python_canonical = _canonical_results( |
| 166 | { |
| 167 | name: results |
| 168 | for name, results in python_results.items() |
| 169 | if name in RUST_SUPPORTED_CHECKERS |
| 170 | } |
| 171 | ) |
| 172 | rust_canonical = _canonical_results(rust_results) |
| 173 | |
| 174 | if python_canonical == rust_canonical: |
| 175 | print("Rust/Python C++ linter A/B parity passed for supported checkers.") |
| 176 | return True |
| 177 | |
| 178 | print("Rust/Python C++ linter A/B parity failed.", file=sys.stderr) |
| 179 | _print_diff_sample("Python-only", python_canonical - rust_canonical) |
| 180 | _print_diff_sample("Rust-only", rust_canonical - python_canonical) |
| 181 | return False |
| 182 | |
| 183 | |
| 184 | def merge_checker_results( |
no test coverage detected