Skip to content

ci: add Markdown docstring check - #1393

Merged
Aaron ("AJ") Steers (aaronsteers) merged 1 commit into
release-candidate/v1from
devin/1792118241-docstring-markdown-check
Oct 16, 2026
Merged

Aaron ("AJ") Steers (aaronsteers) merged 1 commit into
release-candidate/v1from
devin/1792118241-docstring-markdown-check

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Overview

👉 TL;DR: Adds a CI check that fails when docstrings use reStructuredText markup instead of Markdown. pdoc renders docstrings as Markdown, so RST shows up literally in the published docs.

Specifically, this adds scripts/check_docstring_markdown.uv (copied from the ai-skills python-coding-standards skill), a Python Docstring Format Check job in python_lint.yml, and a poe lint-docstrings task.

Changes

  • scripts/check_docstring_markdown.uv: the ai-skills checker, verbatim except _DEFAULT_PACKAGE = "airbyte" and the CONTRIBUTING path in the hint. AST-scoped to docstrings only; flags double backticks, :meth:-style roles, and :param:-style field lists.
  • .github/workflows/python_lint.yml: new docstring-markdown-check job. It needs only setup-uv; the script's shebang pins Python.
  • pyproject.toml: new lint-docstrings Poe task, also appended to poe check.
  • CONTRIBUTING.md: one bullet under ## Docstring Style naming the job and the local command.
  • Fixed the 9 existing violations, all double backticks → single (docstring text only), in airbyte/_util/api_util.py and airbyte/cli/smoke_test_source/source.py.

Design notes: one PR instead of the skill's rule + effects stack

Show/Hide Content

The ai-skills recipe recommends two stacked PRs (rule, then mechanical fixes) because most codebases start with hundreds of violations. RC had only 9, so the fixes ride along and this PR is green on its own.

Test plan

  • ./scripts/check_docstring_markdown.uv and poe lint-docstrings pass on the branch.
  • A temporary docstring containing ``x`` made the checker exit 1 (fixture not committed).
  • ruff check, ruff format --check on the edited files; actionlint .github/workflows/python_lint.yml.

Link to Devin session: https://app.devin.ai/sessions/4d1ece6885c44c52a07034e025db11e6
Open in Devin Desktop: https://app.devin.ai/desktop/session/4d1ece6885c44c52a07034e025db11e6?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)

Important

Auto-merge enabled.

This PR is set to merge automatically when all requirements are met.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792118241-docstring-markdown-check' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792118241-docstring-markdown-check'

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

This comment was marked as resolved.

@github-code-quality

github-code-quality Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest-no-creds

release-candidate/v1 d9f652f devin/1792118241-doc... f1ab2a3 +/-
65% 79% +14%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1792118241-doc... f1ab2a3 +/-
airbyte/_util/api_util.py 36% 66% +30%
airbyte/mcp/cloud.py 52% 85% +33%
airbyte/cloud/connectors.py 34% 79% +45%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/_direct...ctors/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest

release-candidate/v1 d9f652f devin/1792118241-doc... f1ab2a3 +/-
71% 82% +11%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1792118241-doc... f1ab2a3 +/-
airbyte/cloud/connectors.py 51% 83% +32%
airbyte/mcp/cloud.py 52% 85% +33%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/_direct...ctors/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-unit

release-candidate/v1 devin/1792118241-doc... f1ab2a3 +/-
— 76% —

Line coverage data for the release-candidate/v1 branch is not yet available.

View coverage of the 10 most covered files.
File release-candidate/v1 devin/1792118241-doc... f1ab2a3 +/-
airbyte/cloud/models.py — 97% —
airbyte/mcp/_sso_auth.py — 96% —
airbyte/_direct...ctors/models.py — 95% —
airbyte/cloud/client.py — 90% —
airbyte/exceptions.py — 89% —
airbyte/mcp/cloud.py — 85% —
airbyte/progress.py — 80% —
airbyte/cloud/connectors.py — 79% —
airbyte/shared/...ql_processor.py — 68% —
airbyte/_util/api_util.py — 66% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 16, 2026 02:51 UTC

@aaronsteers
Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review October 16, 2026 19:26
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit 30c42ad into release-candidate/v1 Oct 16, 2026
36 of 37 checks passed
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) deleted the devin/1792118241-docstring-markdown-check branch October 16, 2026 19:27

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Devin Review

Comment thread scripts/check_docstring_markdown.uv
_DEFAULT_PACKAGE = "airbyte"

# Double backticks, excluding a run of three or more (fence delimiters).
_DOUBLE_BACKTICK = re.compile(r"(?<!`)``(?!`)")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Code examples falsely fail docstring checks

When a fenced Markdown example contains ``, _DOUBLE_BACKTICK flags it as invalid inline markup. Valid examples then fail CI despite containing no RST formatting.

Learn more

_DOUBLE_BACKTICK matches pairs anywhere in a docstring. Markdown code fences can contain arbitrary source code, including doubled backticks, without using reStructuredText formatting. The checker already permits three-backtick delimiters, but still scans the example inside them.

Example: A docstring with a fenced Python block containing print('``') reports a double-backtick violation and exits 1, although the fenced block is valid Markdown.

Recommended fix: Exclude fenced code blocks before searching for inline RST syntax. Cover both backtick and tilde Markdown fences in tests.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Valid edge case, but nothing in the codebase triggers it. The checker passes on release-candidate/v1, so no current docstring has a fenced example containing double backticks. This script is a verbatim copy of the ai-skills checker (only _DEFAULT_PACKAGE and the hint path differ). Skipping fenced blocks should therefore go into ai-skills first and then be re-copied here, so the two copies don't drift. Not opening a follow-up for now. If a real docstring ever hits this, the CI failure will name the file and line.

Written by Devin

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.

2 participants