diff --git a/crates/ruff_cpp_codegen/src/render.rs b/crates/ruff_cpp_codegen/src/render.rs index 783dae4a6e7afe..f0b5c587fac8b4 100644 --- a/crates/ruff_cpp_codegen/src/render.rs +++ b/crates/ruff_cpp_codegen/src/render.rs @@ -207,7 +207,14 @@ mod tests { // generated text stops compiling in the consumer repo (operator-gated, // rarely run) — this catches the render side in-env. (baton-auditor // boundary guard.) - for field in ["name:", "params:", "ret:", "is_const:", "is_static:", "overrides:"] { + for field in [ + "name:", + "params:", + "ret:", + "is_const:", + "is_static:", + "overrides:", + ] { assert!( s.contains(field), "rendered MethodSig literal must carry the `{field}` field" diff --git a/crates/ruff_csharp_spo/examples/validate_load.rs b/crates/ruff_csharp_spo/examples/validate_load.rs index 4050d7f02f47ad..7f5955a136a96e 100644 --- a/crates/ruff_csharp_spo/examples/validate_load.rs +++ b/crates/ruff_csharp_spo/examples/validate_load.rs @@ -2,6 +2,9 @@ fn main() { let ndjson = std::fs::read_to_string(std::env::args().nth(1).unwrap()).unwrap(); match ruff_csharp_spo::load(&ndjson) { Ok(triples) => println!("LOAD OK: {} triples", triples.len()), - Err(e) => { println!("LOAD FAILED: {e}"); std::process::exit(1); } + Err(e) => { + println!("LOAD FAILED: {e}"); + std::process::exit(1); + } } } diff --git a/crates/ruff_python_spo/examples/odoo_nav_probe.rs b/crates/ruff_python_spo/examples/odoo_nav_probe.rs index 47b175b4952866..efde93e0ff605e 100644 --- a/crates/ruff_python_spo/examples/odoo_nav_probe.rs +++ b/crates/ruff_python_spo/examples/odoo_nav_probe.rs @@ -9,19 +9,33 @@ use ruff_python_spo::{NavVocab, extract_odoo_nav_edges_with_report}; fn main() { - let root = std::env::args().nth(1).expect("usage: odoo_nav_probe "); + let root = std::env::args() + .nth(1) + .expect("usage: odoo_nav_probe "); // Vocab: the account-addon core screens (normalized model names). let screens = [ - "account_move", "account_move_line", "res_partner", "res_company", - "account_account", "account_journal", "account_payment", - "account_bank_statement", "account_analytic_line", "account_tax", + "account_move", + "account_move_line", + "res_partner", + "res_company", + "account_account", + "account_journal", + "account_payment", + "account_bank_statement", + "account_analytic_line", + "account_tax", ]; - let vocab = NavVocab { screens: screens.iter().map(|s| (*s).to_string()).collect() }; + let vocab = NavVocab { + screens: screens.iter().map(|s| (*s).to_string()).collect(), + }; let (edges, report) = extract_odoo_nav_edges_with_report(std::path::Path::new(&root), &vocab); println!( "py={} xml={} raw_act_window={} files_with_edges={} edges={}", - report.py_files, report.xml_files, report.raw_act_window_refs, - report.files_with_edges, edges.len() + report.py_files, + report.xml_files, + report.raw_act_window_refs, + report.files_with_edges, + edges.len() ); for e in &edges { println!(" {} -> {} [{}] {}", e.source, e.target, e.via, e.file); diff --git a/crates/ruff_python_spo/examples/odoo_view_probe.rs b/crates/ruff_python_spo/examples/odoo_view_probe.rs index 8707575ad6d653..21106891ec3d6a 100644 --- a/crates/ruff_python_spo/examples/odoo_view_probe.rs +++ b/crates/ruff_python_spo/examples/odoo_view_probe.rs @@ -13,14 +13,39 @@ fn main() { let target = ViewTarget { model: "account_move".into(), receivers: vec![], - fields: ["partner_id","date","amount_total","amount_untaxed","amount_tax", - "invoice_date","invoice_date_due","journal_id","currency_id","state", - "ref","narration","invoice_line_ids","line_ids","payment_state"] - .iter().map(|s| (*s).to_string()).collect(), + fields: [ + "partner_id", + "date", + "amount_total", + "amount_untaxed", + "amount_tax", + "invoice_date", + "invoice_date_due", + "journal_id", + "currency_id", + "state", + "ref", + "narration", + "invoice_line_ids", + "line_ids", + "payment_state", + ] + .iter() + .map(|s| (*s).to_string()) + .collect(), }; - let (sets, report) = extract_odoo_view_field_sets_with_report(std::path::Path::new(&root), &[target]); - println!("xml={} view_records={} hits={}", report.xml_files, report.view_records, report.views_with_hits); + let (sets, report) = + extract_odoo_view_field_sets_with_report(std::path::Path::new(&root), &[target]); + println!( + "xml={} view_records={} hits={}", + report.xml_files, report.view_records, report.views_with_hits + ); for s in sets.iter().take(6) { - println!(" {} fields={}/{} referenced", s.view, s.fields.len(), s.referenced.len()); + println!( + " {} fields={}/{} referenced", + s.view, + s.fields.len(), + s.referenced.len() + ); } } diff --git a/crates/ruff_python_spo/src/functions.rs b/crates/ruff_python_spo/src/functions.rs index 41d5cb55322002..53a001ef4c3d65 100644 --- a/crates/ruff_python_spo/src/functions.rs +++ b/crates/ruff_python_spo/src/functions.rs @@ -59,7 +59,14 @@ use crate::{RawMethod, expr_str}; /// ruby's `AR_MUTATORS`: deliberately narrow (not every call, just the ORM's /// own mutator vocabulary) per `.claude/knowledge/fuzzy-recipe-codebook.md` /// §2. -const ORM_MUTATORS: &[&str] = &["create", "write", "unlink", "update", "copy", "flush_recordset"]; +const ORM_MUTATORS: &[&str] = &[ + "create", + "write", + "unlink", + "update", + "copy", + "flush_recordset", +]; /// Analyse a method into its decorator + body facts. pub(crate) fn analyze_method(func: &StmtFunctionDef) -> RawMethod { diff --git a/crates/ruff_python_spo/src/odoo_nav.rs b/crates/ruff_python_spo/src/odoo_nav.rs index 9fd16c6debddfe..b1eff1c3d4c82e 100644 --- a/crates/ruff_python_spo/src/odoo_nav.rs +++ b/crates/ruff_python_spo/src/odoo_nav.rs @@ -470,7 +470,11 @@ class AccountMove(models.Model): write(&dir, "models/account_move.py", PY_ACTION); let v = vocab(&["account_move_line"]); let (edges, report) = extract_odoo_nav_edges_with_report(&dir, &v); - assert_eq!(edges.len(), 1, "exactly the literal-res_model edge: {edges:?}"); + assert_eq!( + edges.len(), + 1, + "exactly the literal-res_model edge: {edges:?}" + ); assert_eq!(edges[0].source, "account_move"); assert_eq!(edges[0].target, "account_move_line"); assert_eq!(edges[0].via, "act_window_return"); @@ -532,7 +536,10 @@ class MoveExt(models.Model): // `account_move_lines` (plural) deliberately does NOT match. let v = vocab(&["account_move_lines"]); let (edges, report) = extract_odoo_nav_edges_with_report(&dir, &v); - assert!(edges.is_empty(), "exact matching must reject the plural: {edges:?}"); + assert!( + edges.is_empty(), + "exact matching must reject the plural: {edges:?}" + ); assert_eq!(report.raw_act_window_refs, 2); cleanup(dir); } diff --git a/crates/ruff_ruby_spo/src/functions.rs b/crates/ruff_ruby_spo/src/functions.rs index 9035ec6055d2b1..7e5e49519d4401 100644 --- a/crates/ruff_ruby_spo/src/functions.rs +++ b/crates/ruff_ruby_spo/src/functions.rs @@ -1373,7 +1373,10 @@ class M end "#, ); - assert!(funcs[0].writes.is_empty(), "ivar or-asgn must not be a field write"); + assert!( + funcs[0].writes.is_empty(), + "ivar or-asgn must not be a field write" + ); assert!(funcs[0].guarded_writes.is_empty()); } diff --git a/crates/ruff_spo_triplet/src/exam_config.rs b/crates/ruff_spo_triplet/src/exam_config.rs index 6c2875d6ec1161..4cf087c364e052 100644 --- a/crates/ruff_spo_triplet/src/exam_config.rs +++ b/crates/ruff_spo_triplet/src/exam_config.rs @@ -249,6 +249,9 @@ mod tests { #[test] fn malformed_region_row_with_no_separator_is_skipped() { let cfg = parse("region=bogus\nregion=left:left_nav\n"); - assert_eq!(cfg.regions, vec![("left".to_string(), "left_nav".to_string())]); + assert_eq!( + cfg.regions, + vec![("left".to_string(), "left_nav".to_string())] + ); } } diff --git a/crates/ruff_spo_triplet/src/lib.rs b/crates/ruff_spo_triplet/src/lib.rs index 66f4f4c0c96553..084bbe930c6336 100644 --- a/crates/ruff_spo_triplet/src/lib.rs +++ b/crates/ruff_spo_triplet/src/lib.rs @@ -86,8 +86,8 @@ pub use ir::{ }; pub use nav_digest::build_nav_digest; pub use ndjson::{ParseError, from_ndjson, to_ndjson}; -pub use reassemble::{cpp_projection, reassemble}; pub use quad::{MenuQuad, PurposeRole, PurposeRule, classify_purpose}; +pub use reassemble::{cpp_projection, reassemble}; pub use recipe::{RecipeCentroid, classify, is_recoverable}; pub use region::{RegionFact, RegionSubject, region_triples}; pub use structured_names::{ diff --git a/crates/ruff_spo_triplet/src/nav_digest.rs b/crates/ruff_spo_triplet/src/nav_digest.rs index 6af5c8b6edebe1..c4f07176ed971f 100644 --- a/crates/ruff_spo_triplet/src/nav_digest.rs +++ b/crates/ruff_spo_triplet/src/nav_digest.rs @@ -460,7 +460,10 @@ pub fn build_nav_digest(triples: &[Triple], config: &ExamConfig) -> String { } else { "leaf" }; - let _ = writeln!(out, "{node} loc={loc} purpose={purpose} id={id} action={action}"); + let _ = writeln!( + out, + "{node} loc={loc} purpose={purpose} id={id} action={action}" + ); } out @@ -581,7 +584,12 @@ mod tests { "form", Provenance::Inferred, ), - Triple::new("app:Invoice", Predicate::Purpose, "list", Provenance::Inferred), + Triple::new( + "app:Invoice", + Predicate::Purpose, + "list", + Provenance::Inferred, + ), ] } @@ -702,17 +710,44 @@ Invoice loc=Invoice purpose=list id=- action=root ..ExamConfig::default() }; let triples = vec![ - Triple::new("app:Root", Predicate::SurfacesConcept, "root_c", Provenance::Authoritative), - Triple::new("app:Mid", Predicate::SurfacesConcept, "mid_c", Provenance::Authoritative), - Triple::new("app:Leaf", Predicate::SurfacesConcept, "leaf_c", Provenance::Authoritative), - Triple::new("app:Mid", Predicate::PartOf, "app:Root", Provenance::Inferred), - Triple::new("app:Leaf", Predicate::PartOf, "app:Mid", Provenance::Inferred), + Triple::new( + "app:Root", + Predicate::SurfacesConcept, + "root_c", + Provenance::Authoritative, + ), + Triple::new( + "app:Mid", + Predicate::SurfacesConcept, + "mid_c", + Provenance::Authoritative, + ), + Triple::new( + "app:Leaf", + Predicate::SurfacesConcept, + "leaf_c", + Provenance::Authoritative, + ), + Triple::new( + "app:Mid", + Predicate::PartOf, + "app:Root", + Provenance::Inferred, + ), + Triple::new( + "app:Leaf", + Predicate::PartOf, + "app:Mid", + Provenance::Inferred, + ), Triple::new("app:Leaf", Predicate::Purpose, "form", Provenance::Inferred), ]; let digest = build_nav_digest(&triples, &config); // Leaf's location is the full ancestor classid path, root-first. assert!( - digest.contains("Leaf loc=0x0900/0x0910/0x0911 purpose=form id=0x0911 action=navigate"), + digest.contains( + "Leaf loc=0x0900/0x0910/0x0911 purpose=form id=0x0911 action=navigate" + ), "leaf must lower to the pure radix path 0x0900/0x0910/0x0911:\n{digest}" ); // Root: parentless, has no out-edge here, so it is a leaf node with its @@ -727,8 +762,18 @@ Invoice loc=Invoice purpose=list id=- action=root #[test] fn menu_quad_conflicting_part_of_is_order_independent() { let mut triples = vec![ - Triple::new("app:Leaf", Predicate::PartOf, "app:Zparent", Provenance::Inferred), - Triple::new("app:Leaf", Predicate::PartOf, "app:Aparent", Provenance::Inferred), + Triple::new( + "app:Leaf", + Predicate::PartOf, + "app:Zparent", + Provenance::Inferred, + ), + Triple::new( + "app:Leaf", + Predicate::PartOf, + "app:Aparent", + Provenance::Inferred, + ), ]; let forward = build_nav_digest(&triples, &config()); triples.reverse(); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4933b3ba170755..72436043232cab 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.95" +channel = "1.97.1"