Skip to content

Commit 7d7a2d3

Browse files
ci: make CI genuinely green — rust-ci toolchain pin + fmt/clippy (#43)
## Summary Make CI genuinely green. The shared rust-ci pin on `main` predates standards#439, so the SHA-pinned `dtolnay/rust-toolchain` step errors out before the job runs. This bumps the pin so rust-ci actually runs, and brings the Rust sources to fmt + clippy(`-D warnings`) clean under the CI toolchain (stable 1.96). ## Changes - **rust-ci:** bump `rust-ci-reusable.yml` pin `d135b05` → `8dc2bf0` (current `standards` HEAD; includes #439 toolchain fix + #441/#442). - **Rust hygiene:** `cargo fmt` + `clippy --fix` where the repo had pre-existing drift, so `cargo fmt --all -- --check` and `cargo clippy --locked --all-targets -- -D warnings` pass. ## RSR Quality Checklist ### Required - [x] Tests pass (`cargo test --locked --all-targets`) - [x] Code is formatted (`cargo fmt --all -- --check`) - [x] Linter is clean (`cargo clippy --locked --all-targets -- -D warnings`) - [x] No banned language patterns - [x] SPDX license headers present on modified files - [x] No secrets, credentials, or `.env` files included ## Testing Verified locally with the CI toolchain (rustc/clippy/rustfmt 1.96.0): `cargo fmt --check`, `clippy -D warnings`, `cargo check --locked`, `cargo test --locked` all pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 80ce6f9 commit 7d7a2d3

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/rust-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ permissions:
1414

1515
jobs:
1616
rust-ci:
17-
uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@d135b05bfc647d0c0fbfedc7e80f37ea50f49236
17+
uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@8dc2bf039d1ff0372d650895c46bea7fbaec68ff

src/abi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ mod tests {
506506

507507
#[test]
508508
fn test_custom_distribution_valid() {
509-
let d =
510-
Distribution::new_custom("mixture(0.5, normal(0,1), normal(5,2))".to_string()).expect("TODO: handle error");
509+
let d = Distribution::new_custom("mixture(0.5, normal(0,1), normal(5,2))".to_string())
510+
.expect("TODO: handle error");
511511
assert_eq!(d.kind(), "custom");
512512
}
513513

src/codegen/codegen.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ fn emit_header(code: &mut String, project_name: &str) {
6363
writeln!(code, "// Project: {}", project_name).expect("TODO: handle error");
6464
writeln!(code, "// SPDX-License-Identifier: MPL-2.0").expect("TODO: handle error");
6565
writeln!(code).expect("TODO: handle error");
66-
writeln!(code, "module {} where", sanitize_identifier(project_name)).expect("TODO: handle error");
66+
writeln!(code, "module {} where", sanitize_identifier(project_name))
67+
.expect("TODO: handle error");
6768
writeln!(code).expect("TODO: handle error");
6869
}
6970

@@ -78,7 +79,8 @@ fn emit_distribution_declarations(code: &mut String, variables: &[ParsedVariable
7879
let btype = betlang_type(&var.distribution);
7980

8081
writeln!(code, "/// {} — {}", var.name, info.description).expect("TODO: handle error");
81-
writeln!(code, "/// Sampling method: {}", info.sampling_method).expect("TODO: handle error");
82+
writeln!(code, "/// Sampling method: {}", info.sampling_method)
83+
.expect("TODO: handle error");
8284
writeln!(code, "/// Support: {}", info.support).expect("TODO: handle error");
8385
writeln!(
8486
code,
@@ -113,15 +115,17 @@ fn emit_ternary_helpers(code: &mut String, variables: &[ParsedVariable]) {
113115
writeln!(code).expect("TODO: handle error");
114116

115117
writeln!(code, "/// Kleene strong three-valued AND").expect("TODO: handle error");
116-
writeln!(code, "let ternary_and(a: Ternary, b: Ternary) -> Ternary =").expect("TODO: handle error");
118+
writeln!(code, "let ternary_and(a: Ternary, b: Ternary) -> Ternary =")
119+
.expect("TODO: handle error");
117120
writeln!(code, " match (a, b) with").expect("TODO: handle error");
118121
writeln!(code, " | (False, _) | (_, False) -> False").expect("TODO: handle error");
119122
writeln!(code, " | (True, True) -> True").expect("TODO: handle error");
120123
writeln!(code, " | _ -> Unknown").expect("TODO: handle error");
121124
writeln!(code).expect("TODO: handle error");
122125

123126
writeln!(code, "/// Kleene strong three-valued OR").expect("TODO: handle error");
124-
writeln!(code, "let ternary_or(a: Ternary, b: Ternary) -> Ternary =").expect("TODO: handle error");
127+
writeln!(code, "let ternary_or(a: Ternary, b: Ternary) -> Ternary =")
128+
.expect("TODO: handle error");
125129
writeln!(code, " match (a, b) with").expect("TODO: handle error");
126130
writeln!(code, " | (True, _) | (_, True) -> True").expect("TODO: handle error");
127131
writeln!(code, " | (False, False) -> False").expect("TODO: handle error");
@@ -191,7 +195,8 @@ fn emit_entry_point(code: &mut String, variables: &[ParsedVariable], config: &Ab
191195
}
192196

193197
writeln!(code, " }}").expect("TODO: handle error");
194-
writeln!(code, " report(results, confidence={})", config.confidence).expect("TODO: handle error");
198+
writeln!(code, " report(results, confidence={})", config.confidence)
199+
.expect("TODO: handle error");
195200
}
196201

197202
/// Sanitize a project name into a valid Betlang module identifier.

0 commit comments

Comments
 (0)