Skip to content

Commit 90af7a3

Browse files
committed
Gate review maps on diagnostics
1 parent b36623f commit 90af7a3

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ rss verify-rust [--json] <file.rss> --out-dir <directory>
417417

418418
`rss lint` runs the same frontend checks and emits warning diagnostics for reviewability issues. The first lint is `RSL001`, which flags public signatures that exceed the current review budget for parameter count, generic parameter count, effect count, or nested type depth.
419419

420+
`rss review --map` checks inputs before emitting a map. Files with frontend errors produce diagnostics instead of potentially misleading review classifications.
421+
420422
If a lowered package contains `fn main() -> Unit` or `fn main() -> Result<Unit, E>`, `rss lower --rust --out-dir` also emits a Rust `src/main.rs` harness. `rss run <file.rss>` uses the same lowering path, writes a temporary Rust package, and delegates execution to `cargo run`. Use `rss run <file.rss> --out-dir <directory>` to keep the generated Rust package for inspection.
421423

422424
`rss verify-rust <file.rss> --out-dir <directory>` keeps the generated package used for backend checking, including `rsscript-source-map.json`, so unmappable rustc diagnostics can be inspected against the generated Rust.

src/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,18 @@ fn run_review_map(json: bool, path: &str) -> ExitCode {
816816
return ExitCode::from(2);
817817
}
818818
};
819+
let diagnostics = sources
820+
.iter()
821+
.flat_map(|source| analyze_source(&source.path, &source.contents))
822+
.collect::<Vec<_>>();
823+
if diagnostics
824+
.iter()
825+
.any(|diagnostic| diagnostic.severity.is_error())
826+
{
827+
print_diagnostics(json, &diagnostics);
828+
return ExitCode::from(1);
829+
}
830+
819831
let source_refs = sources
820832
.iter()
821833
.map(|source| (source.path.as_str(), source.contents.as_str()))

0 commit comments

Comments
 (0)