Skip to content

Conversation

@b-long
Copy link
Owner

@b-long b-long commented Dec 7, 2025

This pull request focuses on improving code quality, documentation, and development tooling for the OpenTDF Python SDK. The main changes include enforcing stricter linting and docstring standards, updating development dependencies, and enhancing code documentation and structure across several modules.

Linting, Docstrings, and Tooling Improvements:

  • Updated the pyproject.toml to enforce stricter linting rules, including pydocstyle and pydoclint, set the target Python version to 3.10, and added per-file docstring rule ignores for tests and generated code. [1] [2]
  • Upgraded the ruff-pre-commit hook version in .pre-commit-config.yaml to v0.14.8.
  • Changed the recommended VSCode extension from golang.go to charliermarsh.ruff to align with Python linting. (.vscode/extensions.json)

Code Documentation and Structure:

  • Added or improved module-level and class-level docstrings for better clarity and compliance in files such as src/otdf_python/aesgcm.py, src/otdf_python/assertion_config.py, src/otdf_python/asym_crypto.py, and src/otdf_python/auth_headers.py. [1] [2] [3] [4]
  • Standardized and clarified docstrings for methods and classes, particularly in cryptography-related modules and test configuration files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

These changes collectively improve code maintainability, readability, and enforce consistent documentation practices throughout the codebase.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @b-long, 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 a maintenance update, specifically upgrading the version of the ruff-pre-commit hook used in the project's pre-commit configuration. This ensures that the latest version of the ruff linter is utilized for automated code quality checks before commits are made. It's important to note that despite the title, no direct changes to docstrings are present in this PR.

Highlights

  • Dependency Update: The ruff-pre-commit hook version has been updated from v0.14.6 to v0.14.8 in the .pre-commit-config.yaml file.
  • Title Discrepancy: The pull request title indicates 'improve docstrings', however, the actual changes only involve updating a linter version and do not directly modify any docstrings.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

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 updates the version of the ruff-pre-commit hook from v0.14.6 to v0.14.8. While keeping dependencies up-to-date is a good practice, the pull request title, "chore(main): improve docstrings", is misleading as the changes do not involve docstring improvements. To maintain a clear and accurate commit history, I recommend updating the title to more accurately reflect the changes, for example: chore: Bump ruff pre-commit hook to v0.14.8.

@b-long b-long force-pushed the chore/improve-docstrings branch from 960a110 to 4a0825a Compare December 9, 2025 02:14
@b-long
Copy link
Owner Author

b-long commented Dec 9, 2025

/gemini review

@b-long b-long requested a review from Copilot December 9, 2025 02:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances code documentation by adding comprehensive module-level and function-level docstrings throughout the test suite and source code, converting multi-line docstrings to single-line format where appropriate, and configuring linting rules to enforce docstring standards.

Key Changes:

  • Added module-level docstrings to all Python files
  • Converted multi-line docstrings to single-line format following PEP 257
  • Enhanced pyproject.toml with docstring linting rules (pydocstyle and pydoclint)
  • Updated pre-commit configuration to use latest ruff version

Reviewed changes

Copilot reviewed 105 out of 105 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Added docstring linting rules and per-file ignores for test files
.pre-commit-config.yaml Updated ruff version to v0.14.8
tests/**/*.py Added module and function docstrings throughout test suite
src/otdf_python/**/*.py Added module docstrings and improved existing docstrings
support files Added docstrings to support and configuration files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@b-long b-long changed the title chore(main): improve docstrings chore(main): enforce & provide improved code comments Dec 9, 2025
b-long and others added 2 commits December 8, 2025 21:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 a significant improvement to the codebase by enabling more ruff linting rules, particularly for docstrings (pydocstyle), and applying the necessary fixes across the entire project. The changes are extensive, adding and reformatting docstrings to be compliant with PEP 257, which greatly enhances code clarity and maintainability. The updates to .pre-commit-config.yaml and pyproject.toml are well-structured and the gradual approach to enabling new rules is sensible. Overall, this is an excellent contribution to the project's quality. I have one minor suggestion for code simplification.

@b-long b-long merged commit 2e6709f into main Dec 9, 2025
10 checks passed
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