Skip to content

style: run cargo fmt to fix CI formatting check#2

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-rustfmt-issues
Closed

style: run cargo fmt to fix CI formatting check#2
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-rustfmt-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 18, 2026

cargo fmt --all -- --check has been failing on every push to main since the initial commit — source files were committed without running rustfmt.

  • Reformatted 23 files across facelock-camera, facelock-cli, facelock-daemon, facelock-store, facelock-tpm, and facelock-polkit
  • Pure formatting change — no logic modifications
  • Unblocks the TPM Tests (swtpm) and Container PAM Smoke Test jobs, both gated on build-and-test
Original prompt

Problem

The CI / Build, Test, Lint job (run #23226165732) has been failing on every push to main since the initial commit. The failing step is:

cargo fmt --all -- --check

The job exits with code 1 because a number of Rust source files are not formatted according to rustfmt's rules.

Root Cause

Several files across the workspace were committed without being run through cargo fmt. The CI log shows diffs (lines with -/+) in at least the following files:

  • crates/facelock-camera/src/lib.rs — multi-line tracing::warn! call
  • crates/facelock-cli/src/commands/bench.rs — method chain formatting
  • crates/facelock-cli/src/commands/devices.rs — method chain reformatting
  • crates/facelock-cli/src/direct.rs — match arm formatting
  • crates/facelock-daemon/src/auth.rs — long if condition
  • crates/facelock-daemon/src/enroll.rs — match arm formatting
  • crates/facelock-tpm/src/sealing.rs — multiple long method chains and closure arguments

Fix

Run cargo fmt --all in the workspace root to reformat all files in place, then commit the result.

Steps to reproduce the fix:

  1. Checkout the main branch
  2. Run cargo fmt --all
  3. Commit all changed files with a message like style: run cargo fmt to fix CI formatting check

This should make the Check formatting step pass, which will unblock the downstream TPM Tests (swtpm) and Container PAM Smoke Test jobs (both of which needs: build-and-test).

Acceptance Criteria

  • cargo fmt --all -- --check passes with exit code 0
  • The CI Build, Test, Lint job passes
  • No logic changes — only formatting

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Address the failing CI issues on main

Assistant: Now I have a clear picture of the failing CI. The "Build, Test, Lint" job (the root gate) is failing due to cargo fmt --check — the logs show rustfmt diffs across multiple source files. The code was committed without being formatted, and cargo fmt --all -- --check catches the discrepancies. Let me open a PR to fix this.

Assistant: I'm waiting for your response to the tool call dialog to continue.

This pull request was created from Copilot chat.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: tyvsmith <309657+tyvsmith@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI failures due to rustfmt formatting issues style: run cargo fmt to fix CI formatting check Mar 18, 2026
Copilot AI requested a review from tyvsmith March 18, 2026 02:49
@tyvsmith tyvsmith closed this Mar 21, 2026
tyvsmith added a commit that referenced this pull request May 24, 2026
…rvice opt-in

Replaces the hardcoded [sudo, polkit-1, hyprlock] list with a
PAM_CANDIDATES table that is filtered at runtime by /etc/pam.d/<service>
existence, then presented to the user one service at a time via
dialoguer::Confirm.

New services covered:
- swaylock (Sway/wlroots screen lock) — default YES
- kscreenlocker_greet (KDE Plasma screen lock) — default YES
- gdm-password (GNOME display manager login screen) — default NO
- sddm (KDE display manager login screen) — default NO
- lightdm (Ubuntu/Xfce/Mint display manager login screen) — default NO

Default-YES rationale: screen lockers have safe password fallback; worst
case is an extra Enter keypress.

Default-NO rationale: display manager login screens lock users out of the
system if face auth fails and they have no other recovery path; opt-in
should be explicit.

Explicit non-targets (never offered, even if /etc/pam.d/<name> exists):
- system-auth / common-auth: shared stacks that would spread face auth to
  passwd, su, chsh, chfn, etc.
- login: TTY login; camera may not be initialized at boot.
- su, passwd, chsh, chfn: credential/privilege-change tools that must
  require a real password.

Wizard flow change: replaces MultiSelect-all-at-once with individual
Confirm prompts so the user sees the default recommendation per service.
Non-interactive mode uses each candidate's default_enabled value.

Adds two unit tests:
- detect_candidates_filters_by_presence: verifies candidates_in() against
  a TempDir; only services with a matching file are returned.
- no_excluded_services_in_candidates: asserts the excluded service list
  never appears in PAM_CANDIDATES.

Adds tempfile as a dev-dependency of facelock-cli.

Note: PR #1 (uninstall cleanup) and PR #2 (PAM confirmation prompt) are
racing. This PR may have minor conflicts with #2 if both touch the
per-service iteration; resolve at merge time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants