Skip to content

cli: document the errors of public fallible functions in depcheck and module_bazel (part of #12395) - #14628

Merged
TrapsterDK merged 2 commits into
mainfrom
cloud/12395
Nov 23, 2026
Merged

TrapsterDK merged 2 commits into
mainfrom
cloud/12395

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Part of #12395

Clears clippy::missing_errors_doc (pedantic) in two //cli crates. Every public function that returns a Result gets a # Errors section. Functions that had no doc also get a one-line summary.

  • //cli/depcheck: 58 sites (manifest and lock parsers, cmd_consistency, cmd_locks, cmd_usage, find_missing, find_unused, find_usages and others).
  • //cli/module_bazel: 51 sites (ModuleFile readers and editors, identity::validate_*, load_with_includes, label_path, include_rel).

Docs only. No code changes.

Measured with --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect --output_groups=clippy_checks --@rules_rust//rust/settings:clippy_flag=-Dclippy::missing_errors_doc over //cli/depcheck/... //cli/module_bazel/...: 109 sites before, 0 after.

Tested: tools/dx test //cli/depcheck/... //cli/module_bazel/... passed: //cli/depcheck:adopt_locks_test, //cli/depcheck:depcheck_bin_test, //cli/depcheck:depcheck_test, //cli/depcheck:repo_locks_test, //cli/module_bazel:dx_module_bazel_test (5/5). tools/dx check --apply on the 30 touched files: no findings.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

affected tests (linux_x86_64, shard 0) at 1845888 failed 4 tests. None of them come from this docs-only diff:


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

affected tests (linux_x86_64, shard 2) at 1845888 failed 3 tests. All come from main, not from this diff:

This PR changes only doc comments in //cli/depcheck and //cli/module_bazel, plus the generate snapshot fix.


Generated by Claude Code

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merge train: dropped, //tools/ci:lock_registry_test gains new violations from this PR (the rest of its failure is preexisting on main): name cli/depcheck/src/ecosystem/beam.rs mix.exs: read the name from the registry (same for dotnet, go, js, python, ruby, rust ecosystem files). See docs/design/locks.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS

claude and others added 2 commits November 23, 2026 08:30
… module_bazel (part of #12395)

Clears clippy::missing_errors_doc in //cli/depcheck (58 sites) and
//cli/module_bazel (51 sites). Each public function that returns a
Result gets a `# Errors` section, plus a one-line summary where it had
no doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hz7pt5D3ebRnkfBrgN
…e (part of #12395)

The lock registry test forbids Rust sources from stating manifest and lock
names that docs/design/locks.md says to read from the registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Fixed: rebased onto main (7de68ac; the generate snapshot commit dropped as already upstream) and reworded the new doc summaries in cli/depcheck/src/ecosystem/{beam,dotnet,go,js,python,ruby,rust}.rs so they name the tool (Mix, Paket, Go, npm, Python project, Bundler, Cargo) instead of registry manifest/lock file names, which //tools/ci:lock_registry_test forbids in Rust sources.

Tested: tools/dx test //tools/ci:lock_registry_test //cli/depcheck/...: the 4 depcheck tests pass. lock_registry_test no longer reports any file this PR touches. It still fails on violations already on main in files outside this diff (cli/update/src/discover/cabal.rs, cli/update/src/recovery.rs, deploy/private/src/crates.rs, deploy/private/src/pub_dev.rs, go/private/tools/gofumpt/gofumpt.go, ruby/private/gems.bzl, tools/docs/dart/extract/src/doc.rs).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxcqqAoDeuSr83mscS

Copy link
Copy Markdown
Collaborator Author

At bcbf717, shards 0 and 2 still fail, but not because of this PR. The only new failure is //cli/adopt:dx_adopt_test, case scaffold::tests::go_files_get_the_gopls_tier_view (cli/adopt/src/scaffold.rs:1912, left: Bool(false) right: true). It fails the same way on origin/main ac1d0f3, checked locally. It most likely comes from main's tier default changes (#14697/#14716). The others (loaders_test, versions_contract, consumer_deps_test, module_extension_srcs_test, apple_consumer_test, dart_consumer_test) are the main failures noted above.


Generated by Claude Code

@TrapsterDK
TrapsterDK merged commit 3351b70 into main Nov 23, 2026
5 of 7 checks passed
@TrapsterDK
TrapsterDK deleted the cloud/12395 branch November 23, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

train Tested; land via merge train

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants