Skip to content

Commit e61bef8

Browse files
cscheidclaude
andcommitted
style(quarto-yaml-validation): apply cargo fmt
Pre-existing rustfmt drift on main (multi-line assert!, closure body wrapping) that landed because CI has no fmt gate. Applying the formatting so the tree is `cargo fmt --all -- --check` clean, ahead of adding the CI gate that would otherwise fail on this debt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 42bb65b commit e61bef8

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

crates/quarto-yaml-validation/src/diagnostic.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,10 @@ object:
628628
let vd = ValidationDiagnostic::from_validation_error(&error, &source_ctx);
629629
let compact = vd.to_compact();
630630
assert!(compact.starts_with("[Q-1-10] (root): Missing required property 'version'"));
631-
assert!(!compact.contains('\n'), "compact output must be a single line");
631+
assert!(
632+
!compact.contains('\n'),
633+
"compact output must be a single line"
634+
);
632635
}
633636

634637
#[test]

crates/quarto-yaml-validation/src/validator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ fn validate_generic(
192192
// Bind this schema node's `errorMessage` (if any) for the duration of its
193193
// validation, so any failure raised here picks it up as a custom hint.
194194
let hint = schema.annotations().error_message.as_deref();
195-
context.with_custom_hint(hint, |context| validate_generic_inner(value, schema, context))
195+
context.with_custom_hint(hint, |context| {
196+
validate_generic_inner(value, schema, context)
197+
})
196198
}
197199

198200
fn validate_generic_inner(

crates/quarto-yaml-validation/tests/integration/validation_diagnostic.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ string:
347347
let registry = quarto_yaml_validation::SchemaRegistry::new();
348348

349349
let result = validate(&doc, &schema, &registry, &source_ctx);
350-
assert!(result.is_err(), "Validation should fail for pattern mismatch");
350+
assert!(
351+
result.is_err(),
352+
"Validation should fail for pattern mismatch"
353+
);
351354

352355
let error = result.unwrap_err();
353356
assert_eq!(
@@ -366,7 +369,9 @@ string:
366369
"the authored errorMessage should be the only hint"
367370
);
368371
assert!(
369-
!hints.iter().any(|h| h.contains("matches the expected format")),
372+
!hints
373+
.iter()
374+
.any(|h| h.contains("matches the expected format")),
370375
"the generic pattern hint must not appear"
371376
);
372377

@@ -414,7 +419,10 @@ string:
414419
assert!(result.is_err());
415420

416421
let error = result.unwrap_err();
417-
assert_eq!(error.custom_hint.as_deref(), Some("must be a lowercase identifier"));
422+
assert_eq!(
423+
error.custom_hint.as_deref(),
424+
Some("must be a lowercase identifier")
425+
);
418426

419427
let diagnostic = ValidationDiagnostic::from_validation_error(&error, &source_ctx);
420428
assert_eq!(

0 commit comments

Comments
 (0)