Repository navigation
ci: Ungate the shell's clippy hook, so Linux-only code meets -D warnings - #326
Merged
Merged
Conversation
The Ubuntu job already runs pre-commit and already installs the Tauri headers, so deleting the uname guard is the whole gate — no new workflow step. Unverified until CI runs: `platform/x11/` does not build on macOS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
omesser
force-pushed
the
ci/321-lint-linux
branch
from
September 4, 2026 15:37
b6be608 to
9529339
Compare
Owner
Author
|
Correcting a claim I made in the description before the first run: I said the gate was green over the current tree. It was not. Ubuntu failed on two findings, both now fixed in this branch, and both in code no linter had seen:
Which is the argument for the change, made better than the issue made it: the gate caught a defect shipped hours earlier, in exactly the class of code it exists to cover, and nothing else in the repository could have. — Claude Code, on @omesser's behalf. |
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
No job denied warnings over Linux-only code. Every other platform arm is linted
somewhere;
src-tauri/src/platform/x11/and everytarget_os = "linux"armwere compiled and never linted.
The hook that should have done it refused to.
cargo-clippy-shellalready rancargo clippy -p ai-buddy --all-targets -- -D warnings, but its entry beganif [ "$(uname -s)" != Darwin ]; then echo "skipped"; exit 0; fi— so it was ano-op on Linux, including inside the Ubuntu CI job that runs pre-commit. The
Windows job denies warnings and never compiles those arms; Ubuntu compiled them
under
cargo test, which does not fail on a warning.What changed
The guard is deleted. One file,
.pre-commit-config.yaml.That is the whole gate: the Ubuntu job already runs pre-commit and already
installs the Tauri headers, so ungating the hook is enough. The alternative —
a new
cargo clippy --workspacestep in the workflow — was rejected for addinga second cargo invocation beside the pre-commit one, and for putting the Linux
rule in a workflow while the identical macOS rule lives in the hook file, which
is two places for one rule to drift.
The hook's comment said the shell "needs macOS". That has not been true since
tests.ymlstarted installing the Linux headers, so it is replaced.A machine whose window layer the shell cannot link now fails here rather than
printing "skipped", and the error names the missing library. That is the honest
answer: a skip claimed the crate had been checked.
How to verify
Proven by planting
use std::collections::BTreeSet;at the top ofplatform/x11/settings_window.rs— 1136 lines that no linter had ever seen —and dispatching the workflow on that commit:
run 33889642478.
The same hook, the same command, the same commit:
cargo clippy (shell)error: unused import: std::collections::BTreeSetThat asymmetry is the gap, demonstrated. The planted commit was then removed;
this branch is the one-file change.
The gate was not green over the tree, and that is the result. Its first run
over the real branch failed Ubuntu on two findings in code no linter had ever
seen, both fixed here:
platform/x11/settings_window.rs:320—unused variable: writes. Introducedby the refactor(settings): Let the compiler check what a form row writes #287 rebase over feat(shell): Batch the Director fields behind Apply and Cancel #279, where the secure field became always-batched
and the binding stayed. It merged in refactor(settings): Let the compiler check what a form row writes #319 and was on
main. Nowwrites: _,the same way the AppKit window already spells the three it does not read.
frame_loop.rs:131—type_complexityon the X11-onlylast_mask,Arc<Mutex<Vec<(Option<Vec<bool>>, i32, i32, i32, i32)>>>. Pre-existing andcfg-gated to the X11 lane. Now a named
MaskParams.Most of the previously unlinted code had been checked before pushing, which is
why only two survived:
x11rbis pure Rust, so temporarily widening thedependency table from
cfg(all(unix, not(target_os = "macos")))tocfg(unix)— dropping onlygtk, which has no pkg-config on macOS — compilessix of the eight
platform/x11files locally, and all 938 lines pass-D warnings. That harness was validated by planting an unused import and alet_and_returnand confirming clippy flagged them, then reverted in full.settings_window.rsis the one file it could not reach, and that is where thereal finding was.
cargo fmt,cargo clippy --workspace --all-targets -- -D warningsandcargo testare clean locally (205 shell, 414 core).Notes
Findings this gate does not force, spotted while reading the one file that
still cannot be compiled here. None is a default lint, so all are out of scope
for a
ci:change, and two look worth their own issues:platform/x11/overlay.rs:40—configure_overlayopens a freshRustConnection::connect(None)instead of the sharedsuper::connection::connection()that every other call site uses.window_classis duplicated verbatim betweenplatform/x11/sensing.rsandplatform/x11/window_source.rs.platform.rs—due()has two byte-identical bodies under different cfgs,and the comment on the second describes a difference the code no longer has.
platform/x11/settings_window.rs—should_omit_rowfilters the two consentids in
build_section, andbuild_rowre-checks them, so one check isunreachable;
help_line's doc comment opens with a line describingpack.Closes #321
— Claude Code, on @omesser's behalf.