Skip to content

Draft: enable missing_docs lint (phase 1)#1327

Open
rydrman wants to merge 3 commits intomainfrom
docs/missing-docs-phase-1
Open

Draft: enable missing_docs lint (phase 1)#1327
rydrman wants to merge 3 commits intomainfrom
docs/missing-docs-phase-1

Conversation

@rydrman
Copy link
Collaborator

@rydrman rydrman commented Feb 24, 2026

Pull Request: docs: enable missing_docs lint (phase 1)

Branch: docs/missing-docs-phase-1

PR URL: https://github.com/spkenv/spk/pull/new/docs/missing-docs-phase-1


Summary

This is the first phase of incrementally enabling the deny(missing_docs) lint across the workspace. The goal is to improve API documentation while keeping merge requests accessible for review.

Phase 0 - Infrastructure (this PR)

  • Add workspace-level warn(missing_docs) lint to Cargo.toml
  • Add #![allow(missing_docs)] for generated code (FlatBuffers/protobuf) in:
    • spfs-proto/src/lib.rs
    • spfs/src/proto/mod.rs

Phase 1 - Document utility and CLI crates (this PR)

Added crate-level and module documentation to:

  • is_default_derive_macro - derive macro for IsDefault trait
  • parsedbuf - validated string wrapper macro
  • sentry-miette - sentry integration for miette errors
  • spk-schema/tera - template rendering with tera
  • spfs-cli/common - shared CLI argument structures
  • All spk-cli command crates (cmd-*, group*)

Upcoming Phases

This is the first of several PRs to fully enable the lint:

Phase Target Crates Est. Items
Phase 2 spk-solve sub-crates, spk-config, spk, spfs-cli/main ~160
Phase 3 spk-cli/common (deep), spk-solve, spk-build ~205
Phase 4 spk-solve/graph, spk-exec, spk-storage ~170
Phase 5 spk-schema, spk-schema/foundation, spfs ~1,330
Phase 6 Change workspace lint from warn to deny -

Each subsequent phase will be a separate PR targeting ~100-150 documentation items to keep reviews manageable.

Test Plan

  • cargo check --workspace succeeds with warnings (not errors)
  • Generated code is properly excluded via #![allow(missing_docs)]
  • CI passes

Changes Summary

  • Files modified: 26
  • Lines added: ~130
  • Warnings reduced: from ~2,541 to ~2,031 (510 items documented)

Files Changed

Infrastructure

  • Cargo.toml - Added missing_docs = "warn" to workspace lints
  • crates/spfs-proto/src/lib.rs - Added crate docs and #![allow(missing_docs)]
  • crates/spfs/src/proto/mod.rs - Added #![allow(missing_docs)] for generated code

Utility Crates

  • crates/is_default_derive_macro/src/lib.rs
  • crates/parsedbuf/src/lib.rs
  • crates/sentry-miette/src/lib.rs
  • crates/spk-schema/crates/tera/src/error.rs

SPFS CLI

  • crates/spfs-cli/common/src/lib.rs
  • crates/spfs-cli/common/src/args.rs

SPK CLI Commands

  • crates/spk-cli/cmd-build/src/lib.rs
  • crates/spk-cli/cmd-convert/src/lib.rs
  • crates/spk-cli/cmd-debug/src/lib.rs
  • crates/spk-cli/cmd-du/src/lib.rs
  • crates/spk-cli/cmd-env/src/lib.rs
  • crates/spk-cli/cmd-explain/src/lib.rs
  • crates/spk-cli/cmd-install/src/lib.rs
  • crates/spk-cli/cmd-make-binary/src/lib.rs
  • crates/spk-cli/cmd-make-recipe/src/lib.rs
  • crates/spk-cli/cmd-make-source/src/lib.rs
  • crates/spk-cli/cmd-render/src/lib.rs
  • crates/spk-cli/cmd-repo/src/lib.rs
  • crates/spk-cli/cmd-test/src/lib.rs
  • crates/spk-cli/group1/src/lib.rs
  • crates/spk-cli/group2/src/lib.rs
  • crates/spk-cli/group3/src/lib.rs
  • crates/spk-cli/group4/src/lib.rs

rydrman and others added 3 commits February 18, 2026 17:45
The monolithic spfs::Error enum had 47 variants covering everything from
runtime management to object storage to serialization. This makes it
difficult for callers to reason about which errors can actually occur in
a given context.

This change extracts the 13 runtime-related variants into a new
crate::runtime::error::Error type, following the existing pattern used
by encoding::Error and graph::ObjectError. The new type is included in
the root Error via a #[from] conversion, so existing code that
propagates errors with `?` continues to work unchanged.

Variants moved:
- NothingToCommit, NoActiveRuntime, RuntimeNotInitialized
- UnknownRuntime, RuntimeExists, RuntimeUpperDirAlreadyInUse
- DoesNotSupportDurableRuntimePath, RuntimeAlreadyEditable
- RuntimeReadError, RuntimeWriteError, RuntimeSetPermissionsError
- CouldNotCreateSpfsRoot, RuntimeChangeToDurableError

This is the first step toward more granular error types across the spfs
API surface.

Signed-off-by: Ryan Bottriell <rbottriell@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ryan Bottriell <rbottriell@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ryan Bottriell <rbottriell@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ryan Bottriell <rbottriell@ilm.com>
This is the first phase of incrementally enabling the deny(missing_docs)
lint across the workspace. This PR:

Phase 0 - Infrastructure:
- Add workspace-level warn(missing_docs) lint to Cargo.toml
- Add #![allow(missing_docs)] for generated code in spfs-proto and
  spfs proto module

Phase 1 - Document utility and CLI crates:
- Add crate-level documentation to:
  - is_default_derive_macro
  - parsedbuf
  - sentry-miette
  - spk-schema/tera
  - spfs-cli/common
  - All spk-cli command crates (cmd-*, group*)

This reduces the missing documentation warnings while keeping the
lint as a warning to allow incremental progress.

Upcoming phases will document the remaining crates:
- Phase 2: spk-solve sub-crates, spk-config, spk, spfs-cli/main
- Phase 3: spk-cli/common, spk-solve, spk-build
- Phase 4: spk-solve/graph, spk-exec, spk-storage
- Phase 5: spk-schema, spk-schema/foundation, spfs (large crates)
- Phase 6: Change workspace lint from warn to deny

Signed-off-by: Ryan Bottriell <rbottriell@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@rydrman rydrman self-assigned this Feb 24, 2026
@rydrman rydrman added documentation Improvements or additions to documentation maintenance Cleanup, upgrades, etc labels Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation maintenance Cleanup, upgrades, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant