Skip to content

chore: enforce ruff docstring rules in first 10 integrations#3008

Merged
julian-risch merged 1 commit intomainfrom
feat/docstring-ruff-rules
Mar 23, 2026
Merged

chore: enforce ruff docstring rules in first 10 integrations#3008
julian-risch merged 1 commit intomainfrom
feat/docstring-ruff-rules

Conversation

@julian-risch
Copy link
Copy Markdown
Member

@julian-risch julian-risch commented Mar 20, 2026

Related Issues

Part 1/5 of of #2947

Proposed Changes:

Enable ruff pydocstyle rules matching haystack-ai main repo config for the first 10 integrations (aimlapi, amazon_bedrock, anthropic, arcadedb, astra, azure_ai_search, azure_doc_intelligence, chroma, cohere, cometapi) and the pyproject.toml template.

  • Add the following rules to [tool.ruff.lint] select in each integration's pyproject.toml:
    • D102 – Missing docstring in public method
    • D103 – Missing docstring in public function
    • D205 – 1 blank line required between summary line and description
    • D209 – Closing triple quotes go to new line
    • D213 – Summary lines must be positioned on the second physical line of the docstring
    • D417 – Missing argument descriptions in the docstring
    • D419 – Docstring is empty
  • Add "D" to tests/**/* per-file-ignores so test files are exempt
  • Fix all resulting docstring violations across the 10 integrations (mainly D205 – missing blank line between summary and description – and a few D102/D103 missing docstrings)
  • Update the pyproject.toml template to include the same rules

How did you test it?

  • Ran hatch run fmt and hatch run fmt-check in each integration directory
  • Ran hatch run test:types in each integration directory – all pass
  • Ran hatch run test:unit in each integration directory – all pass

Notes for the reviewer

This is the first batch of 10 integrations. Remaining integrations will follow in subsequent PRs.
I thought about adding D107, which is not mentioned in the issue. D107 checks that __init__ method definitions have docstrings. I could open one separate PR that adds D107 to all integrations and one PR to add it to Haystack if we agree its beneficial. For consistency it makes sense but there is not much value added but the __init__ docstrings so it's not of importance.

Checklist

…19) in first 10 integrations

Enable ruff pydocstyle rules matching haystack-ai main repo config for:
aimlapi, amazon_bedrock, anthropic, arcadedb, astra, azure_ai_search,
azure_doc_intelligence, chroma, cohere, cometapi, and the pyproject.toml template.

- Add D102, D103, D205, D209, D213, D417, D419 to ruff select in each pyproject.toml
- Ignore D rules in tests/** per-file-ignores
- Fix all resulting docstring violations (missing docstrings, blank line between summary and description)

Closes #2947

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@davidsbatista davidsbatista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@julian-risch julian-risch merged commit 95b01cb into main Mar 23, 2026
68 checks passed
@julian-risch julian-risch deleted the feat/docstring-ruff-rules branch March 23, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants