Repository navigation
chore: format this branch's code, fix its clippy errors and pin the Lint toolchain - #6
Draft
TechArtistG wants to merge 8 commits into
Draft
TechArtistG wants to merge 8 commits into
TechArtistG wants to merge 8 commits into
Conversation
The Lint workflow formats with the latest nightly rustfmt, and cargo +nightly fmt --all --check fails on every pull request against this branch before reaching anything the pull request changes: 117 hunks in 25 files, all in code this branch added on top of upstream 826ad5d, which itself formats clean. This is the output of cargo +nightly fmt --all with rustfmt 1.12.0-nightly (bdf712ee87 2026-11-21), the version the failing runs used. Formatting only. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
…for clippy clippy -D warnings rejects these in code this branch added on top of upstream; each change is the rewrite clippy suggests and leaves behaviour as it was: - doc_markdown: put the identifiers named in doc comments (environment variables, RPC names, ProjFS) in backticks. Comments only. - map_err_ignore: the closures that drop an error now bind it to a named `_` binding (`_elapsed`, `_refused`, `_unavailable`) instead of `_`. The value is still discarded exactly as before. - map_unwrap_or: `.map(f).unwrap_or(a)` becomes `.map_or(a, f)` and `.map(f).unwrap_or(false)` becomes `.is_ok_and(f)`. The defaults are constants, so evaluating them eagerly changes nothing. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
Each of these is the rewrite clippy proposes for code this branch added,
and none changes what the code does:
- items_after_test_module (lore-base fs/lock.rs): `impl Drop for FSLock`
moves above the test module. Item order has no meaning in Rust.
- single_match_else (lore-revision repository.rs, lore-server
authnz/grants.rs): a two-arm match on an Option becomes if let/else with
the same arms in the same order.
- collapsible_if (lore-server auth/jwk.rs): the nested `if let ... { if ...`
becomes one let chain; the read guard is still taken only when a key is
wanted, and the branch still only returns.
- useless_conversion (lore-server repository_metadata_set.rs): drops an
`.into()` from `Partition` to `Partition`.
- unused_self (lore-server stream_authorization_tests.rs): the test
helper `put_request` reads nothing from `self`, so it becomes an
associated function.
- semicolon_if_nothing_returned (lore-server tests/client_renewal.rs),
byte_char_slices (lore-storage fan_out.rs test: `*b"LVN"` is the same
three bytes) and unnested_or_patterns (lore-transport grpc/mod.rs:
`Ok("1" | "true" | "TRUE")` matches the same values).
- unused_async (lore/src/repository.rs): the `mount_impl` built without
the `vfs` feature does not await, but it has to stay `async` like the
two `vfs` versions because `mount` awaits whichever one is built. It
gets a scoped `#[allow(clippy::unused_async)]` saying so.
Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
clippy's disallowed_methods rejects four direct spawns and two direct `std::fs::write` calls in code this branch added. - lore-storage tests (local/flush.rs, local/immutable_store.rs, local/mutable_store.rs, packstore.rs) spawn with `lore_base::lore_spawn!` instead of `tokio::spawn` / `JoinSet::spawn`, as the workspace clippy.toml asks. Inside a runtime, `lore_spawn!` spawns on `Handle::try_current()`, which is the test's own runtime. The tests set no `LORE_CONTEXT`, so nothing is scoped, and `ObservedTask` does nothing without a lifecycle callback. The tasks therefore run where and as they did before. - lore-revision `write_mount_binding` writes the mount-binding file in `.lore`. lore-revision's clippy.toml asks for a `RepositoryWriteToken`-gated helper, or an `allow` on an authorized writer. Gating it would change the signature of a pub function the `lore` crate calls, so it gets the scoped `allow` with a reason, as the repository ID writer in the same file already does. - lore-revision tests/cross_vcs.rs writes a `.loreignore` fixture before any repository exists; the statement gets a scoped `allow` with a reason. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
clippy's large_futures flags the startup-refusal tests in lore-server's server.rs: `start` wraps `async_main` (about 11 KB) in a timeout, so `start` and each test that awaits it hold an 11 KB future on the stack. Pinning `async_main` in a Box at that one call site, as clippy suggests, moves it to the heap and clears all five reports. The same future runs under the same 30 s timeout; only where its state lives changes. Test code only. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
clippy's too_many_arguments flags two functions: - lore-revision stage.rs `stage_filesystem_path` (10 arguments). Upstream carries `#[allow(clippy::too_many_arguments)]` and its doc comment on this function. When this branch added `ensure_not_git_tracked` (fcca0ec), it was inserted between them and the function, so they ended up on the new helper. This moves the four upstream lines back to the function they belong to, as upstream has them. No code changes. - lore-server grpc/server.rs `GrpcServerBuilder::with_http2_config` grew a seventh setting (`build_guard`) on this branch, making 8 with `self`. It is public and called positionally from lore-server, its tests and lore-integration-tests, so a parameter struct would change its signature. It gets the same scoped allow, with a comment saying why. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
clippy's doc_markdown flags `ProjFS` in the doc comment of `staged_delete_paths` in lore-revision/src/vfs/core.rs. The module is only built with the `vfs` feature, which the Lint workflow's clippy run (default features) never enables, so this showed up only under `cargo clippy --features vfs`. Comment only. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
…026-11-22 Lint installs the latest nightly for rustfmt and uses whatever stable the runner has for clippy. On 2026-11-22 that was clippy 1.100.0, which fails 157 places in upstream code this branch never changed (empty_enums on zerocopy derive output, map(..).unwrap_or_default(), result_large_err, ...). Upstream fixed these on main in cd28d44, which does not apply to this branch. With these pins, Lint checks every pull request against the same toolchains this branch is clean on: - clippy and cargo-deny run on 1.97.1, set as the default toolchain the pre-commit hooks' plain `cargo` resolves to. - cargo-fmt runs on nightly-2026-11-22 (rustfmt bdf712ee87), named in the hook entry so a local `pre-commit run` formats the same way. Drop this commit when the branch moves to an upstream that has cd28d44, or once the remaining 1.100 lints are fixed. Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
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.
What changes
pre-commitfails on every pull request intofeature/v0.8.14-stress-fixes, for reasons that are in the branch and not in the pull requests. This PR makes the Lint job pass at the base, so that it shows what a pull request adds.rustfmt. One commit formats it: 25 files, formatting only.#[allow], each with its reason in a comment.lint.ymlused whichever stable Rust the runner had. Stable 1.100 reports 157 more errors, all in upstream code that this branch does not modify. Upstream fixed those later incd28d446, which does not apply to this branch. The last commit pins clippy to 1.97.1 andrustfmttonightly-2026-11-22. Drop that commit when this branch takes the upstream fix.Not changed
.into()that a change on this branch had made redundant.impl Drop for FSLockgoes above its test module, and the doc comment and#[allow]ofstage_filesystem_pathgo back onto that function.vfsfeature. That code was linted by hand for this PR.Tests
On Linux:
cargo +nightly-2026-11-22 fmt --all --checkpasses.pre-commit run --all-fileswith Rust 1.97.1 as the default toolchain passes. That is the Lint job's command.cargo +1.97.1 clippy --all-targets --features vfs -p lore-revision -p lore -p lore-client -- -D warnings --no-depspasses.lore-base,lore-transport,lore-credential,lore-storage,lore-server,lore-revisionandlore;lore-server --test client_renewal;lore-revision --test cross_vcs; and with--features vfs, the library tests oflore-revisionandloreandlore-revision --test vfs_fuse.Not run: Windows and macOS builds, and the other integration test targets. The pinned Lint workflow runs for the first time on this pull request.