MCPcopy Create free account
hub / github.com/FastLED/FastLED / run_rust_ab_check

Function run_rust_ab_check

ci/lint_cpp/rust_bridge.py:159–181  ·  view source on GitHub ↗

Compare Rust-supported checker output against the Python oracle.

(
    python_results: dict[str, CheckerResults],
    files: list[str] | None,
)

Source from the content-addressed store, hash-verified

157
158
159def 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
184def merge_checker_results(

Callers 1

mainFunction · 0.90

Calls 5

run_rust_linterFunction · 0.85
_canonical_resultsFunction · 0.85
_print_diff_sampleFunction · 0.85
itemsMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected