Skip to content

Improve Rustdoc examples for public and test-support APIs #346

Description

@lodyai

Finding

Public API documentation is present in many places, but example coverage is uneven relative to the repository guidance that function documentation should include clear usage examples.

High-volume areas from the audit:

  • src/status.rs
  • src/stdlib/config.rs
  • src/cli/parser.rs
  • src/theme.rs
  • src/runner/mod.rs
  • src/ast.rs
  • test_support/src/env.rs
  • test_support/src/env_guard.rs

The audit also found missing Rustdoc on several public or crate-visible helpers, including runner process file I/O helpers and glob helper methods.

Why This Matters

The crate enables strict docs linting, but the project standard is stronger than “has some docs”. Missing examples make public APIs harder to use correctly and reduce doctest value.

Proposed Fix

Add realistic # Examples sections to the highest-use public APIs first, then work through remaining public and reusable test-support APIs. Add missing /// comments for public helper methods and type aliases found during the audit.

Acceptance Criteria

  • Highest-use public APIs listed above have examples or a documented reason why an example would be misleading.
  • Missing Rustdoc on public runner/glob helpers is filled in.
  • New examples compile or are explicitly marked no_run/ignore with a reason.
  • make check-fmt, make lint, and make test pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions