Skip to content

Lint docstrings with Google style and run their examples - #310

Merged
palewire merged 2 commits into
mainfrom
docstring-lint
Nov 17, 2026
Merged

palewire merged 2 commits into
mainfrom
docstring-lint

Conversation

@palewire

Copy link
Copy Markdown
Owner

This makes the template check docstrings so new projects start with complete documentation.

  • Turns on Ruff's docstring style rules using the Google convention.
  • Turns on Ruff's docstring completeness rules: a missing Returns, Yields or Raises section is now an error. These rules are still in Ruff's preview, so they are selected by exact code.
  • Runs the examples in docstrings as tests (--doctest-modules, and scripts/ is now in the test paths).
  • Rewrites the docstrings in scripts/worktree_bootstrap.py to pass, with arguments, returns, raises and examples.
  • Adds the rule to AGENTS.md. Tests are exempt from the docstring rules.

Limit: Ruff has no rule that requires an Examples section, so that part is a written convention. We can check that examples run, not that they exist.

make verify passes locally.

Closes #309

🤖 Generated with Claude Code

palewire and others added 2 commits November 16, 2026 19:34
@palewire
palewire merged commit 9bcd80c into main Nov 17, 2026
22 checks passed
@palewire
palewire deleted the docstring-lint branch November 17, 2026 00:43
@palewire palewire mentioned this pull request Nov 17, 2026
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.

Lint docstrings and require Google style sections

1 participant