Skip to content

Adopt clippy::pedantic across the Rust crates - #660

Closed
tinder-maxwellelliott wants to merge 1 commit into
Tinder:masterfrom
maxwellE:claude/clippy-pedantic
Closed

tinder-maxwellelliott wants to merge 1 commit into
Tinder:masterfrom
maxwellE:claude/clippy-pedantic

Conversation

@tinder-maxwellelliott

@tinder-maxwellelliott tinder-maxwellelliott commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Every first-party crate (the bazel-diff lib and binary, the e2e suite and tools/coverage) now opts into clippy::pedantic at the crate root, with a short, commented allow list for the lints that do not fit a CLI crate (the doc-section and must_use lints, too_many_lines, similar_names, struct_excessive_bools, case-sensitive extension checks on Bazel labels, implicit_hasher). The generated protobuf module is exempt.

The rest of the warnings are fixed, and most of the fixes simplify the code they touch: match-for-destructuring becomes if-let/let-else, format!-then-push_str becomes write!/writeln!, Result wrappers that could not fail are gone (deduplicate_targets, prune_cache), arguments that were cloned to be passed by value are borrowed instead (break_module_cycles, compute_query, normalize_path, probe_options), with_exclude_filter consumes its query instead of cloning it, the extension-failure bookkeeping moves onto FailedExtensions as methods instead of taking an unused &self on BazelOptions, and one elapsed_millis helper (now saturating instead of truncating) replaces two copies.

Every first-party crate (the bazel-diff lib and binary, the e2e suite and
tools/coverage) now opts into clippy::pedantic at the crate root, with a
short, commented allow list for the lints that do not fit a CLI crate
(the doc-section and must_use lints, too_many_lines, similar_names,
struct_excessive_bools, case-sensitive extension checks on Bazel labels,
implicit_hasher). The generated protobuf module is exempt.

The rest of the warnings are fixed, and most of the fixes simplify the
code they touch: match-for-destructuring becomes if-let/let-else,
format!-then-push_str becomes write!/writeln!, Result wrappers that
could not fail are gone (deduplicate_targets, prune_cache), arguments
that were cloned to be passed by value are borrowed instead
(break_module_cycles, compute_query, normalize_path, probe_options),
with_exclude_filter consumes its query instead of cloning it, the
extension-failure bookkeeping moves onto FailedExtensions as methods
instead of taking an unused &self on BazelOptions, and one elapsed_millis
helper (now saturating instead of truncating) replaces two copies.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJs3XwoUGNh7WtEZHGSPVn
@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator Author

Superseded by #661, which carries the same change merged with master. This branch lives on a fork the Tinder account cannot push to.

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