← GDG /

#056 gdtest_exclude_cli

#056 gdtest_exclude_cli OK CONFIG
Config exclusion with CLI documentation
Config-level exclusion (B5) with CLI documentation. Two API exports are excluded via config, plus a Click CLI. The sidebar should show CLI Reference. The API Reference should show only the non-excluded items (execute, report) โ€” hidden_func must be absent.
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

A1 B5 C1 D1 E6 F6 G1 H7
A1Flat layoutlayout
B5Config excludeexports
C1Functions onlyobjects
D1NumPydocstrings
E6No directivesdirectives
F6No user guideuser_guide
G1README.mdlanding
H7No extrasextras

Source Files

๐Ÿ“ gdtest_exclude_cli/
๐Ÿ“„ __init__.py
"""Package with config exclusion and CLI."""

__version__ = "0.1.0"
__all__ = ["execute", "report", "hidden_func"]


def execute(task: str) -> dict:
    """
    Execute a task.

    Parameters
    ----------
    task
        Task name to execute.

    Returns
    -------
    dict
        Execution results.
    """
    return {"task": task, "status": "done"}


def report() -> str:
    """
    Generate a report.

    Returns
    -------
    str
        Report text.
    """
    return "report"


def hidden_func() -> None:
    """
    This function is excluded via config โ€” should not appear.

    Returns
    -------
    None
    """
    pass
๐Ÿ“„ cli.py
"""CLI for gdtest_exclude_cli."""

try:
    import click
except ImportError:
    import sys
    print("click not installed", file=sys.stderr)
    sys.exit(1)


@click.group()
def main():
    """Main CLI entry point."""
    pass


@main.command()
@click.argument("task")
def run(task):
    """Run a specific task."""
    click.echo(f"Running {task}")


@main.command()
def show():
    """Show the current report."""
    click.echo("Report output")
๐Ÿ“„ README.md
# gdtest-exclude-cli

Tests config-level exclusion combined with CLI docs.
๐Ÿ“„ great-docs.yml
exclude:
  - hidden_func
cli:
  enabled: true