Skip to content

docs: auto-format docstring examples using ruff (DM-3079)#2521

Merged
haakonvt merged 3 commits intopysdk-release-v8from
autofmt-docstring-examples
Mar 20, 2026
Merged

docs: auto-format docstring examples using ruff (DM-3079)#2521
haakonvt merged 3 commits intopysdk-release-v8from
autofmt-docstring-examples

Conversation

@haakonvt
Copy link
Contributor

Moved from #2516

@haakonvt haakonvt requested review from a team as code owners March 20, 2026 08:38
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the consistency and readability of code examples in docstrings throughout the project. By integrating ruff for automated docstring formatting, it standardizes the presentation of Python code snippets, primarily by adjusting line breaks, adding trailing commas, and consolidating arguments. This change is purely stylistic and aims to enhance the developer experience and maintainability of the documentation.

Highlights

  • Automated Docstring Formatting: Implemented automatic formatting for code examples within docstrings using the ruff tool, ensuring consistent style across the codebase.
  • Improved Readability: Enhanced the readability of documentation by standardizing line breaks, trailing commas, and argument consolidation in Python code snippets within docstrings.
  • Configuration Update: Added ruff format configuration to pyproject.toml to enforce docstring code formatting rules.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.44%. Comparing base (043e50d) to head (b201b22).
⚠️ Report is 5 commits behind head on pysdk-release-v8.

Additional details and impacted files
@@                 Coverage Diff                  @@
##           pysdk-release-v8    #2521      +/-   ##
====================================================
+ Coverage             93.41%   93.44%   +0.03%     
====================================================
  Files                   478      478              
  Lines                 48173    48173              
====================================================
+ Hits                  45000    45016      +16     
+ Misses                 3173     3157      -16     
Files with missing lines Coverage Δ
cognite/client/_api/agents/agents.py 100.00% <ø> (ø)
cognite/client/_api/ai/tools/documents.py 78.57% <ø> (ø)
cognite/client/_api/annotations.py 95.65% <ø> (ø)
cognite/client/_api/assets.py 97.35% <ø> (ø)
cognite/client/_api/data_modeling/containers.py 98.14% <ø> (ø)
cognite/client/_api/data_modeling/data_models.py 100.00% <ø> (ø)
cognite/client/_api/data_modeling/graphql.py 100.00% <ø> (ø)
cognite/client/_api/data_modeling/instances.py 90.88% <ø> (+3.17%) ⬆️
...nite/client/_api/data_modeling/space_statistics.py 100.00% <ø> (ø)
cognite/client/_api/data_modeling/spaces.py 100.00% <ø> (ø)
... and 120 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces automated formatting for docstring code examples using ruff, as configured in pyproject.toml. The changes, applied across numerous files including the auto-generated synchronous API modules, consist of stylistic adjustments like breaking long lines and adding trailing commas. These modifications enhance readability and are consistent with the new formatting rules. The changes appear to be correct and do not introduce any functional issues.

@haakonvt haakonvt changed the title docs: auto-format docstring examples using ruff docs: auto-format docstring examples using ruff (DM-3079) Mar 20, 2026
@haakonvt haakonvt force-pushed the autofmt-docstring-examples branch from e835df8 to b201b22 Compare March 20, 2026 15:27
@haakonvt
Copy link
Contributor Author

🦄

@haakonvt haakonvt self-assigned this Mar 20, 2026
@haakonvt haakonvt added risk-review-ongoing Risk review is in progress waiting-for-team Waiting for the submitter or reviewer of the PR to take an action labels Mar 20, 2026
@haakonvt haakonvt enabled auto-merge March 20, 2026 15:30
@haakonvt haakonvt merged commit d3a6ab3 into pysdk-release-v8 Mar 20, 2026
17 checks passed
@haakonvt haakonvt deleted the autofmt-docstring-examples branch March 20, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-review-ongoing Risk review is in progress waiting-for-team Waiting for the submitter or reviewer of the PR to take an action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants