Add generated compile-time UI contracts - #83
Conversation
Render a `trybuild` pass/fail suite with reviewed compiler diagnostics. Cover Clippy and Rustdoc through a Rust Cargo-command UI harness because `trybuild` invokes only `rustc`, while retaining the Python Makefile integration tests.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Reviewer's GuideThis PR adds a generated Rust compile-time UI harness and fixtures, wires them into the template Cargo config, and documents the lint/diagnostic contract and validation workflow while extending parent and policy tests to cover the new behaviour. Sequence diagram for test_generated_compile_time_ui_contracts and Rust UI harnesssequenceDiagram
actor Pytest
participant PythonParentTests
participant GeneratedProject
participant RustUIHarness as tests_compile_ui_rs
participant Trybuild
participant CargoClippy
participant CargoRustdoc
Pytest->>PythonParentTests: test_generated_compile_time_ui_contracts
PythonParentTests->>GeneratedProject: render_template_project
PythonParentTests->>RustUIHarness: run_tests
RustUIHarness->>Trybuild: run_supported_pass_fixture
Trybuild-->>RustUIHarness: compiler_pass_ok
RustUIHarness->>Trybuild: run_unsafe_code_compile_fail
Trybuild-->>RustUIHarness: compare_unsafe_code_stderr
RustUIHarness->>Trybuild: run_missing_docs_compile_fail
Trybuild-->>RustUIHarness: compare_missing_docs_stderr
RustUIHarness->>CargoClippy: cargo_clippy_ui_cases
CargoClippy-->>RustUIHarness: output
RustUIHarness->>RustUIHarness: compare_clippy_output_with_tests_ui_expected
RustUIHarness->>CargoRustdoc: cargo_doc_ui_cases
CargoRustdoc-->>RustUIHarness: output
RustUIHarness->>RustUIHarness: compare_rustdoc_output_with_tests_ui_expected
RustUIHarness-->>PythonParentTests: all_ui_contracts_pass
PythonParentTests-->>Pytest: assert_success
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Nah, that's just silly. |
Summary
This branch adds a generated Rust compile-time UI harness to resolve the
remaining Testing (Compile-Time / UI) warning from PR #79. It retains the
Python-generated project rejection tests for Makefile integration while
placing reviewed compiler, Clippy, and Rustdoc diagnostic contracts inside
each generated Rust project.
Review walkthrough
trybuildpass/fail flow and the Cargo-command fallback used for Clippy and Rustdoc.trybuildcannot cover Clippy or Rustdoc directly.Validation
make check-fmt: passed; 31 files already formatted.make lint: passed with no warnings.make typecheck: passed; no issues in 31 source files.uvx --with pytest-copier --with pyyaml --with syrupy --with make-parser --with hypothesis pytest tests/test_template/test_compilation.py::test_generated_compile_time_ui_contracts -vv: passed; 1 test.make test: passed; 111 passed, 2 skipped, and 1 snapshot passed.make spelling: passed with typos 1.48.0.Validation did not use
TRYBUILD=overwrite, warning suppressions, or reducedlint severities.
Notes
trybuildowns the compiler pass case and reviewedunsafe_codeandmissing_docs.stderrfiles. The Rust integration harness invokes focusedCargo commands for the Clippy and Rustdoc policies and compares their output
with narrow reviewed diagnostic fragments.
References
Summary by Sourcery
Add a generated Rust compile-time UI harness and fixtures to enforce lint and documentation diagnostic contracts in rendered projects.
New Features:
compile_ui.rsRust test harness that runs trybuild, Clippy, and Rustdoc UI contracts.Enhancements:
Build:
trybuildas a dev-dependency in the Rust template Cargo manifest to support compile-time UI tests.Tests: