desktop: rustfmt the pull tests; run fmt after clippy/test
Two macro-argument splits and a stray blank line, applied verbatim from run 2900's cargo fmt --check diff. Also reorders the Linux job so `cargo fmt --check` runs AFTER clippy and the tests. Fail-fast ordering would normally put the cheapest check first, but there is no Rust toolchain on the workstation, so this lane is verified entirely in CI — and a formatting nit failing first SKIPS clippy and the tests, making a whole cycle teach nothing but whitespace. That has now cost four cycles in this session alone. It still runs before the 20-40 minute bundle build, so a fmt failure doesn't burn that either. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SreJkbxB4gx8pPsu8QbLPi
This commit is contained in:
@@ -52,10 +52,6 @@ jobs:
|
||||
run: npm ci && npm run build
|
||||
working-directory: frontend
|
||||
|
||||
- name: Rust format check
|
||||
run: cargo fmt --check
|
||||
working-directory: desktop/src-tauri
|
||||
|
||||
- name: Clippy
|
||||
run: cargo clippy --all-targets -- -D warnings
|
||||
working-directory: desktop/src-tauri
|
||||
@@ -64,6 +60,18 @@ jobs:
|
||||
run: cargo test
|
||||
working-directory: desktop/src-tauri
|
||||
|
||||
# Deliberately AFTER clippy + test, not before.
|
||||
#
|
||||
# It's the cheapest check, so fail-fast ordering would normally put it first —
|
||||
# but there is no Rust toolchain on the workstation (the desktop lane is
|
||||
# verified entirely here), so a formatting nit failing first SKIPS clippy and
|
||||
# the tests, and one CI cycle teaches nothing but whitespace. Running it here
|
||||
# means every push reports its real problems too. Still before the ~20-40 min
|
||||
# bundle build, so a fmt failure doesn't burn that.
|
||||
- name: Rust format check
|
||||
run: cargo fmt --check
|
||||
working-directory: desktop/src-tauri
|
||||
|
||||
# Frontend already built above; skip the beforeBuildCommand rebuild.
|
||||
- name: Tauri build (deb + AppImage)
|
||||
run: cargo tauri build --config '{"build":{"beforeBuildCommand":""}}'
|
||||
|
||||
@@ -528,7 +528,10 @@ mod tests {
|
||||
apply_page(&conn, &page(vec![n], vec![], 1)).expect("apply");
|
||||
assert_eq!(count(&conn, "SELECT COUNT(*) FROM labels"), 1);
|
||||
assert_eq!(
|
||||
count(&conn, "SELECT via_tag FROM note_labels WHERE note_id = 'n1'"),
|
||||
count(
|
||||
&conn,
|
||||
"SELECT via_tag FROM note_labels WHERE note_id = 'n1'"
|
||||
),
|
||||
1,
|
||||
"via_tag is applied verbatim, not re-derived"
|
||||
);
|
||||
@@ -592,12 +595,15 @@ mod tests {
|
||||
|
||||
assert_eq!(count(&conn, "SELECT COUNT(*) FROM labels"), 1);
|
||||
let label_id: String = conn
|
||||
.query_row("SELECT label_id FROM note_labels WHERE note_id = 'n1'", [], |r| r.get(0))
|
||||
.query_row(
|
||||
"SELECT label_id FROM note_labels WHERE note_id = 'n1'",
|
||||
[],
|
||||
|r| r.get(0),
|
||||
)
|
||||
.expect("membership survived");
|
||||
assert_eq!(label_id, "server-id", "membership re-pointed, not dropped");
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn label_tombstone_deletes_and_cascades_memberships() {
|
||||
let conn = db();
|
||||
|
||||
Reference in New Issue
Block a user