Skip to content

Fix malformed-RST docstring warnings and enable -W in CI#118

Open
levon003 wants to merge 2 commits into
mainfrom
docs/fix-rst-warnings
Open

Fix malformed-RST docstring warnings and enable -W in CI#118
levon003 wants to merge 2 commits into
mainfrom
docs/fix-rst-warnings

Conversation

@levon003

Copy link
Copy Markdown
Member

Addresses items 3, 4, and 6 of #117, getting the docs build to zero warnings so it can be gated with -W.

What changed

  • Suppress peewee back-reference accessors (docs/conf.py). Dataset.messages, EvalSetRun.metrics_list, the m2m *_links, etc. are peewee-generated reverse relations that render as bare names with no docstring or type — and they accounted for 18 of the docutils warnings. They're now filtered in skip_peewee_internals, consistent with the already-suppressed DoesNotExist and <fk>_id members.
  • Fix malformed RST in docstrings (item 3): JsonView, MetricComputer.compute_metrics, the completion_functions module docstring, count_errors, process_conversation, and process_single_message. Dict/code blocks now use :: literal blocks, bullet lists get surrounding blank lines, *_errors is escaped to avoid a stray-emphasis warning, and the two over-indented Google-style docstrings are reflowed. (process_single_message surfaced as a docutils ERROR only once -W was on.)
  • Coerce autodoc-pydantic JSON-schema errors (item 6): FunctionsCollection.functions is a list[Callable], which has no JSON-schema representation by design, so autodoc_pydantic_model_show_json_error_strategy = "coerce" renders the serializable fields instead of warning.
  • Enable -W --keep-going in the validate.yaml docs job (item 4) so doc warnings fail PRs instead of silently accumulating.

Verification

make html SPHINXOPTS="-W --keep-going" exits 0 (was: 35 warnings on main before the #86 work; this brings it to zero). Spot-checked that the fixed docstrings render as proper highlighted code blocks, not mangled text.

Remaining in #117

Items 1 (dead linkcode_resolve), 2 (no-op docutils_conf), 5 (redundant napoleon/numpydoc + unused matplotlib extensions), and 7 (optional make linkcheck).

🤖 Generated with Claude Code

Clears all Sphinx build warnings so the docs build can be gated with -W:

- Suppress peewee back-reference accessors (e.g. `Dataset.messages`) in
  skip_peewee_internals. Like the already-filtered DoesNotExist/`_id` members
  they're peewee-generated, render as bare names with no docstring or type, and
  tripped 18 docutils warnings.
- Fix malformed RST in docstrings (JsonView, MetricComputer.compute_metrics,
  the completion_functions module, count_errors, process_conversation,
  process_single_message): code/dict blocks now use `::` literal blocks, bullet
  lists get blank lines, `*_errors` is escaped, and the two over-indented
  Google-style docstrings are reflowed.
- Coerce instead of warn when autodoc-pydantic can't build a JSON schema for a
  field (FunctionsCollection.functions is a list[Callable], which has no schema
  representation by design).
- Build docs with `-W --keep-going` in the validate.yaml docs job so warnings
  fail the build and can't silently accumulate.

Addresses items 3, 4, and 6 of #117. Verified: `make html SPHINXOPTS="-W
--keep-going"` exits clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Patch release: docstring fixes (which ship in the package) plus docs-build
hygiene. No API or behavior changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant