Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions rust/avdschema/src/schema/dict/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ use crate::utils::schema_data::SchemaDataSequence as _;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Dict {
#[allow(
clippy::doc_markdown,
reason = "snake_case describes the required casing style"
)]
/// Dictionary of dictionary-keys in the format `{<keyname>: {<schema>}}`.
/// `keyname` must use snake_case.
/// `keyname` must use snake case.
/// `schema` is the schema for each key. This is a recursive schema, so the value must conform to AVD Schema
pub keys: Option<OrderMap<String, AnySchema>>,
/// Dictionary of dynamic dictionary-keys in the format `{<variable.path>: {<schema>}}`.
Expand Down
2 changes: 0 additions & 2 deletions rust/python-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
missing_docs,
missing_debug_implementations,
clippy::fn_params_excessive_bools,
clippy::manual_let_else,
clippy::module_name_repetitions,
clippy::needless_pass_by_value,
clippy::struct_excessive_bools,
clippy::unnecessary_trailing_comma,
clippy::unnecessary_wraps,
reason = "PyO3-facing API names and test assertions mirror the exported Python module contract"
)]
Expand Down
2 changes: 1 addition & 1 deletion rust/python-bindings/src/schema_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub(crate) mod _schema_store {
))
})?;
store.as_resolved().map_err(|err| {
PyRuntimeError::new_err(format!("Error while resolving the Schema Store: {err}",))
PyRuntimeError::new_err(format!("Error while resolving the Schema Store: {err}"))
})
}?;

Expand Down
5 changes: 2 additions & 3 deletions rust/python-bindings/src/tests/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ fn validation_result_from_validation_result_internal_error_returns_pyerr() {
infos: vec![],
};

let err = match ValidationResult::from_validation_result(result) {
Ok(_) => panic!("expected internal error to convert into PyErr"),
Err(err) => err,
let Err(err) = ValidationResult::from_validation_result(result) else {
panic!("expected internal error to convert into PyErr");
};

pyo3::Python::attach(|py| {
Expand Down
24 changes: 12 additions & 12 deletions rust/yaml-parser/tests/writer_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
clippy::tests_outside_test_module,
reason = "integration tests in tests/ are top-level by design"
)]
#![allow(
clippy::expect_used,
reason = "panicking on unexpected writer failure is fine in these focused tests"
)]
#![allow(
clippy::float_cmp,
reason = "exact float comparison is intentional for roundtrip equality checks"
)]
#![allow(
clippy::panic,
reason = "panic is expected in test assertions for mismatched value kinds"
Expand Down Expand Up @@ -86,7 +78,11 @@ fn assert_value_eq_ignoring_spans<'input>(expected: &Value<'input>, actual: &Val
assert_eq!(left_int, right_int, "integer value changed");
}
(Value::Float(left_float), Value::Float(right_float)) => {
assert_eq!(left_float, right_float, "float value changed");
assert_eq!(
left_float.to_bits(),
right_float.to_bits(),
"float value changed: left={left_float}, right={right_float}",
);
}
(Value::String(left_str), Value::String(right_str)) => {
assert_eq!(left_str, right_str, "string value changed");
Expand Down Expand Up @@ -124,10 +120,14 @@ fn roundtrip_value(input: &str) {
);

let mut buf = Vec::new();
writer::write_yaml_from_events(&mut buf, &events)
.expect("writing YAML from events should succeed");
if let Err(error) = writer::write_yaml_from_events(&mut buf, &events) {
panic!("writing YAML from events should succeed: {error:?}");
}

let output = String::from_utf8(buf).expect("writer must produce valid UTF-8");
let output = match String::from_utf8(buf) {
Ok(output) => output,
Err(error) => panic!("writer must produce valid UTF-8: {error:?}"),
};

let (docs_after, errors_after) = parse(&output);
assert!(
Expand Down
Loading