You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: deny unwrap, expect, panic and friends in every non-test crate, with a guard #12395
About 19 lib.rs/main.rs roots on main lack the deny block.
clippy::panic, clippy::unimplemented and clippy::exit are not denied. About 263 panic! calls sit in files outside test dirs (some are in #[cfg(test)] modules).
No guard test checks that every crate root carries the block.
Do:
Add clippy::panic, clippy::unimplemented and clippy::exit to the deny set in every crate root.
Add the block to every non-test crate root missing it.
Replace non-test unwrap/expect/panic! with error returns (Result, ?, typed errors). Process exit only in main.
Add a //tools/ci guard that fails when a non-test crate root lacks the full deny set. No allowlist.
Make sure the clippy aspect runs these crates in CI with warnings as errors.
Split by package if large; one PR per package group, Part of this issue.
Decision: the strict tier (--@rules_dx//config:config_tier=strict) also turns these on for consumers. core/quality/tiers/clippy/strict.txt gains the panic, exhaustiveness and unsafe lints from the decision above, tests stay exempt, and the strict tier docs list them. rules_dx itself runs on strict.
Part 1 is #12403: strict tier carries every lint; rules_dx enforces the zero-violation ones; test/testonly crates exempt from the panic family; per-crate deny blocks dropped; guard //tools/ci:lint_attributes_test.
Part 2 is #12413: clippy::exit is zero and denied in .bazelrc (coverage collectors return Result; the Windows ctrl handler in cli/shim has #[expect(clippy::exit, reason = ...)]).
PR #12434 handles the clippy/dead_code/unreachable allows in cli/plan, cli/cli, cli/process, cli/worktree, cli/audit, cli/generate, cli/depcheck and cli/update.
Remaining allow_attributes work:
cfg_attr(not(unix|linux), allow(dead_code)) in cli/process (groups.rs, lifecycle.rs Group, lifecycle_unix.rs, slot_pool.rs), cli/worktree/host.rs and cli/cli/src/exec/stream_probe_tests.rs. These need Windows/macOS clippy to verify.
PR #12516 (draft) gates the remaining platform-only items with cfg (tests gated alike), turns the shared ones into reasoned cfg_attr(..., expect(dead_code)), and denies clippy::allow_attributes / allow_attributes_without_reason in .bazelrc. It needs a green Windows + macOS CI run before it leaves draft.
Next slice: #14590 clears missing_errors_doc in 12 small //cli crates (26 sites). Left in //cli outside //cli/cli: 611 sites, largest first adopt 74, audit 58, depcheck 56, module_bazel 51, update 46, output 38, archive 28, atomic_fs 28, process 27, exec_core 25 (count with --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect --output_groups=clippy_checks --@rules_rust//rust/settings:clippy_flag=-Dclippy::missing_errors_doc); then //cli/cli, too_many_lines, the sweep outside //cli, and families.rust tier strict in dx.toml.
Next slice: #14628 clears missing_errors_doc in //cli/depcheck (58) and //cli/module_bazel (51). Still left in //cli outside //cli/cli: adopt 74, audit 58, update 46, output 38, archive 28, atomic_fs 28, process 27, exec_core 25 and smaller crates. After that come //cli/cli, too_many_lines, the same sweep outside //cli, and families.rust tier strict in dx.toml.
Activity
TrapsterDK commentedon Nov 12, 2026
Decision: enforce once, repo-wide, instead of per-crate blocks.
.dx/bazelrc/correctness.bazelrcclippy flags:-Dclippy::unwrap_used -Dclippy::expect_used -Dclippy::panic -Dclippy::unreachable -Dclippy::todo -Dclippy::unimplemented -Dclippy::exit -Dclippy::indexing_slicing -Dclippy::unwrap_in_result -Dclippy::panic_in_result_fn -Dclippy::get_unwrap -Dclippy::string_slice -Dclippy::fallible_impl_from -Dclippy::wildcard_enum_match_arm -Dclippy::let_underscore_must_use -Dclippy::undocumented_unsafe_blocks -Dclippy::allow_attributes_without_reason -Dclippy::allow_attributes..bazelrcrustc flags:--deny=unsafe_code --deny=unsafe_op_in_unsafe_fn --deny=unused_must_use.tools/workspace/clippy.toml:allow-unwrap-in-tests,allow-expect-in-tests,allow-panic-in-tests,allow-indexing-slicing-in-tests= true.#[expect(<lint>, reason = "...")]on the item.unsafeonly where FFI or the OS needs it, each block with a// SAFETY:line.cfg_attr(not(test), deny(...))blocks.//tools/citest fails on#[allow(of these lints and on an#[expect(withoutreason.Land in parts: config + guard first with existing violations as
#[expect], then remove them package by package.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2i1LBYg969L4ZJRMURT
TrapsterDK commentedon Nov 12, 2026
Decision: the
stricttier (--@rules_dx//config:config_tier=strict) also turns these on for consumers.core/quality/tiers/clippy/strict.txtgains the panic, exhaustiveness and unsafe lints from the decision above, tests stay exempt, and the strict tier docs list them. rules_dx itself runs on strict.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2i1LBYg969L4ZJRMURT
TrapsterDK commentedon Nov 12, 2026
Part 1 is #12403: strict tier carries every lint; rules_dx enforces the zero-violation ones; test/testonly crates exempt from the panic family; per-crate deny blocks dropped; guard
//tools/ci:lint_attributes_test.Remaining, non-test violation counts (testonly excluded):
indexing_slicing~2255,string_slice~655,let_underscore_must_use~439,wildcard_enum_match_arm~196panic~176: cli/test_scratch, cli/gomod, cli/shim, cli/audit, cli/adopt, tools/ci/ci_workflow (deploy/private, tools/testing mostly testonly)unsafe_code~101 (cli/process 67, cli/cli 7, cli/worktree 5, cli/shim 4, more outside cli),undocumented_unsafe_blocks~70allow_attributes/allow_attributes_without_reason~46: cli/plan, cli/cli, cli/process, cli/worktree, cli/audit, cli/generate, cli/depcheck, cli/updateexit~4: tools/coverage/collect, tools/coverage/d, dotnet/private/coverage.bazelrconce its count is zero; finally setfamilies.rusttostrictindx.toml(also bringsclippy::pedantic).🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hwH5AS7ytCaBAYwEtU
rust: strict tier denies panics, unsafe and allow attributes (part of #…
rust: unit tests for the test crate clippy lint exemption (part of #1…
rust: strict tier denies panics, unsafe and allow attributes (part of #…
quality: rustfmt the coverage collectors (part of #12395)
TrapsterDK commentedon Nov 12, 2026
Part 2 is #12413:
clippy::exitis zero and denied in.bazelrc(coverage collectors returnResult; the Windows ctrl handler in cli/shim has#[expect(clippy::exit, reason = ...)]).Remaining:
allow_attributes/allow_attributes_without_reason~46: cli/plan, cli/cli, cli/process, cli/worktree, cli/audit, cli/generate, cli/depcheck, cli/updateundocumented_unsafe_blocks~70,unsafe_code~101wildcard_enum_match_arm,let_underscore_must_use,panic,string_slice,indexing_slicingfamilies.rust = strictindx.toml🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hwH5AS7ytCaBAYwEtU
quality: enforce clippy::exit repo-wide (part of #12395) (#12413)
TrapsterDK commentedon Nov 12, 2026
PR #12434 handles the clippy/dead_code/unreachable allows in cli/plan, cli/cli, cli/process, cli/worktree, cli/audit, cli/generate, cli/depcheck and cli/update.
Remaining allow_attributes work:
cfg_attr(not(unix|linux), allow(dead_code))in cli/process (groups.rs, lifecycle.rsGroup, lifecycle_unix.rs, slot_pool.rs), cli/worktree/host.rs and cli/cli/src/exec/stream_probe_tests.rs. These need Windows/macOS clippy to verify.clippy::allow_attributesandallow_attributes_without_reasonin.bazelrc.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hwH5AS7ytCaBAYwEtU
rust: replace allow attributes in cli crates with expect or code fixe…
TrapsterDK commentedon Nov 12, 2026
PR #12445 turns the remaining plain allows (api_spec, apple, core/quality/runner helm, deploy, dotnet coverage, tools/ci, tools/docs, tools/testing/nested, cli/shim tests, cli/cli update tests) into reasoned expects.
Remaining:
cfg_attr(not(unix|linux), allow(dead_code))in cli/process, cli/worktree/host.rs, cli/cli/src/exec/stream_probe_tests.rs, tools/testing/nested/src/lib.rs (664, 817), tools/testing/hermetic/appcontainer/args.rs (need Windows/macOS clippy)clippy::allow_attributesandallow_attributes_without_reasonin.bazelrcundocumented_unsafe_blocks,unsafe_code,wildcard_enum_match_arm,let_underscore_must_use,panic,string_slice,indexing_slicingfamilies.rust = strictindx.toml🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hwH5AS7ytCaBAYwEtU
rust: replace lint allows outside platform cfg_attr with reasoned exp…
TrapsterDK commentedon Nov 13, 2026
PR #12516 (draft) gates the remaining platform-only items with
cfg(tests gated alike), turns the shared ones into reasonedcfg_attr(..., expect(dead_code)), and deniesclippy::allow_attributes/allow_attributes_without_reasonin.bazelrc. It needs a green Windows + macOS CI run before it leaves draft.Remaining:
undocumented_unsafe_blocks,unsafe_codewildcard_enum_match_arm,let_underscore_must_use,panic,string_slice,indexing_slicingfamilies.rust = strictindx.toml🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hygW8NyPkC1Ea1mT4L
203 remaining items
TrapsterDK commentedon Nov 21, 2026
cloud-claim 773b7f3b
Generated by Claude Code
TrapsterDK commentedon Nov 21, 2026
Next slice: #14590 clears
missing_errors_docin 12 small //cli crates (26 sites). Left in //cli outside //cli/cli: 611 sites, largest first adopt 74, audit 58, depcheck 56, module_bazel 51, update 46, output 38, archive 28, atomic_fs 28, process 27, exec_core 25 (count with--aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect --output_groups=clippy_checks --@rules_rust//rust/settings:clippy_flag=-Dclippy::missing_errors_doc); then //cli/cli,too_many_lines, the sweep outside //cli, andfamilies.rusttier strict in dx.toml.Generated by Claude Code
cli: document the errors of public fallible functions in 12 small cra…
TrapsterDK commentedon Nov 22, 2026
cloud-claim 6c09baa5
Generated by Claude Code
TrapsterDK commentedon Nov 22, 2026
Next slice: #14628 clears
missing_errors_docin //cli/depcheck (58) and //cli/module_bazel (51). Still left in //cli outside //cli/cli: adopt 74, audit 58, update 46, output 38, archive 28, atomic_fs 28, process 27, exec_core 25 and smaller crates. After that come //cli/cli,too_many_lines, the same sweep outside //cli, andfamilies.rusttier strict in dx.toml.Generated by Claude Code
generate: rust render snapshot lists the map_err_ignore and unused_re…
cli: document the errors of public fallible functions in depcheck and…
depcheck: ecosystem doc summaries name the tool, not the registry fil…
cli: document the errors of public fallible functions in depcheck and…