Make the CI checks say what they mean, and format the workspace
The Android job's "Verify minimum API level" step has never verified the minimum API level. It took the first `*.so` anywhere under the target directory, which is a host proc-macro from debug/deps — an x86-64 object built by the runner's gcc, whose .comment section cannot mention Android and so can never contradict the expected value. It now reads the artifact under the target triple, compares against MIN_API parsed from the Dockerfile rather than a second copy of the number, and fails on a mismatch. Both sides are checked non-empty first: two failed parses would otherwise compare equal and pass, which is the same silent success in a new costume. The Android image installs one SDK package per layer and keeps the output. sdkmanager is a JVM program that aborts when it cannot get memory, and the single `> /dev/null` step reported that as a bare "exit code 134" while a retry re-downloaded everything that had already succeeded. tools/ci-local.sh runs all four jobs — desktop, android, layering, traceability — against the host toolchain, which is pinned to the same 1.92.0 CI installs. Its matrix check compares regeneration against the working tree rather than against HEAD: CI starts from a clean checkout, so git's answer is the right one there and reports every local run stale here. The rest is rustfmt across the workspace, and the clippy findings that surfaced once it did: manual_contains in dr-thumbs and collections_ui, a map iterated as pairs for its keys, an index loop over a slice, and two runtime assertions on a constant now made at compile time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -670,7 +670,11 @@ mod tests {
|
||||
height: 0.5,
|
||||
});
|
||||
|
||||
assert_eq!(f.output_size(6000, 4000), before_size, "zoom resized output");
|
||||
assert_eq!(
|
||||
f.output_size(6000, 4000),
|
||||
before_size,
|
||||
"zoom resized output"
|
||||
);
|
||||
assert!(f.crop().is_full(), "zoom altered the crop");
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,10 @@ impl Sidecar {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(uuid) = line.strip_prefix("[version ").and_then(|s| s.strip_suffix(']')) {
|
||||
if let Some(uuid) = line
|
||||
.strip_prefix("[version ")
|
||||
.and_then(|s| s.strip_suffix(']'))
|
||||
{
|
||||
if let Some(v) = current.take() {
|
||||
sidecar.put(v);
|
||||
}
|
||||
@@ -495,9 +498,7 @@ impl Sidecar {
|
||||
// by a build with a wider scale, or hand-edited. An
|
||||
// out-of-range rating would sort above five stars forever and
|
||||
// no filter would reach it.
|
||||
"rating" => {
|
||||
version.rating = value.parse::<u8>().unwrap_or(0).min(MAX_RATING)
|
||||
}
|
||||
"rating" => version.rating = value.parse::<u8>().unwrap_or(0).min(MAX_RATING),
|
||||
"flag" => version.flag = value.parse::<u8>().unwrap_or(0).min(MAX_FLAG),
|
||||
_ => match key.split_once('.') {
|
||||
// An `op.param` line whose value does not parse is a
|
||||
@@ -582,11 +583,10 @@ mod tests {
|
||||
// as neutral rather than as missing.
|
||||
let v = version_of(&edited());
|
||||
assert_eq!(v.params.len(), 2);
|
||||
assert!(v.params.contains_key(&("exposure".into(), "exposure".into())));
|
||||
assert!(!v
|
||||
assert!(v
|
||||
.params
|
||||
.keys()
|
||||
.any(|(op, _)| op == colour::SATURATION_ID.0));
|
||||
.contains_key(&("exposure".into(), "exposure".into())));
|
||||
assert!(!v.params.keys().any(|(op, _)| op == colour::SATURATION_ID.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -602,12 +602,12 @@ mod tests {
|
||||
|
||||
let parsed = Sidecar::parse(&sidecar.to_text()).expect("valid");
|
||||
let mut restored = EditGraph::default_chain();
|
||||
parsed.default_version().expect("a version").apply(&mut restored);
|
||||
parsed
|
||||
.default_version()
|
||||
.expect("a version")
|
||||
.apply(&mut restored);
|
||||
|
||||
assert_eq!(
|
||||
restored.param(exposure::ID, exposure::EXPOSURE),
|
||||
Some(0.75)
|
||||
);
|
||||
assert_eq!(restored.param(exposure::ID, exposure::EXPOSURE), Some(0.75));
|
||||
assert_eq!(
|
||||
restored.param(white_balance::ID, white_balance::TEMPERATURE),
|
||||
Some(30.0)
|
||||
@@ -636,7 +636,10 @@ mod tests {
|
||||
let parsed = Sidecar::parse(&sidecar.to_text()).expect("valid");
|
||||
|
||||
let mut restored = EditGraph::default_chain();
|
||||
parsed.default_version().expect("a version").apply(&mut restored);
|
||||
parsed
|
||||
.default_version()
|
||||
.expect("a version")
|
||||
.apply(&mut restored);
|
||||
|
||||
for cap in g.capabilities() {
|
||||
for p in &cap.params {
|
||||
@@ -670,7 +673,10 @@ mod tests {
|
||||
let parsed = Sidecar::parse(&sidecar.to_text()).expect("valid");
|
||||
|
||||
let mut restored = EditGraph::default_chain();
|
||||
parsed.default_version().expect("a version").apply(&mut restored);
|
||||
parsed
|
||||
.default_version()
|
||||
.expect("a version")
|
||||
.apply(&mut restored);
|
||||
|
||||
assert_eq!(restored.crop(), g.crop());
|
||||
assert_eq!(restored.param(framing::ID, framing::ANGLE), Some(-1.5));
|
||||
@@ -1090,4 +1096,3 @@ mod tests {
|
||||
assert_eq!(format_value(0.75), "0.75");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user