Skip to content

Conversation

@jbampton
Copy link
Contributor

Adds some more automation by creating some pre-commit hook docs in Markdown

Copy link

@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.

Summary of Changes

Hello @jbampton, 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 significantly enhances the project's CI/CD automation by implementing a system to automatically generate and maintain documentation for all configured pre-commit hooks. This ensures that the project's code quality and style standards are transparently documented and easily accessible to all contributors.

Highlights

  • Automated Pre-Commit Hook Documentation: Introduced a new create-pre-commit-docs local hook in .pre-commit-config.yaml. This Python-based hook automatically generates a Markdown file (doc/guides/pre-commit-hooks.md) detailing all configured pre-commit hooks, including their IDs, names, descriptions, and versions.
  • Enhanced Pre-Commit Hook Definitions: Updated existing pre-commit hook definitions within .pre-commit-config.yaml by adding name and description fields. This enrichment provides the necessary metadata for the new documentation generation script to produce comprehensive and informative output.
  • Documentation File Management: Added doc/guides/pre-commit-hooks.md as the target file for the auto-generated pre-commit hook documentation. This file has also been added to .prettierignore to prevent automatic formatting, ensuring the generated content remains as intended.
  • Dependency Management: A new requirements.txt file was added to manage Python dependencies, specifically including pre-commit and pyyaml, which are required for the new documentation generation script.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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

@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 new pre-commit hook to automatically generate documentation for all configured hooks.

@jbampton jbampton force-pushed the add-auto-docs-for-hooks branch from 7bc42d5 to 18d417e Compare July 27, 2025 02:05
@jbampton
Copy link
Contributor Author

/gemini review

Copy link

@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 great automation for generating documentation for the pre-commit hooks, which will improve the project's maintainability. The changes to .pre-commit-config.yaml to add names and descriptions are a good step towards self-documenting configuration.

I've found a few issues that should be addressed:

  • There's a critical error in the description of one of the hooks in .pre-commit-config.yaml.
  • The new requirements.txt file is missing version pinning for dependencies, which can cause issues with build reproducibility.
  • The generated documentation could be more accurate regarding the language of each hook.

Please see my detailed comments for suggestions on how to fix these issues.

@jbampton jbampton force-pushed the add-auto-docs-for-hooks branch 2 times, most recently from d69ebf2 to 9da33b1 Compare July 27, 2025 03:21
@jbampton jbampton changed the title [CI] pre-commit: auto create Markdown hook docs with Python pre-commit: validate hooks and auto create docs with Python Jul 27, 2025
@jbampton
Copy link
Contributor Author

/gemini review

Copy link

@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 great automation for validating the pre-commit configuration and generating documentation for the hooks. The changes to .pre-commit-config.yaml to add names and descriptions to all hooks are extensive but necessary for the new tooling.

However, the main implementation files, .github/workflows/scripts/pre_commit_hooks_validator.py and .github/workflows/scripts/create_pre_commit_docs.py, are missing from this PR. They are referenced in .pre-commit-config.yaml but not included in the changes, so I cannot review the core logic. Please add them to the pull request.

I've added a few specific comments on the files that are present regarding dependency management, configuration consistency, and the accuracy of the generated documentation.

@jbampton jbampton marked this pull request as draft July 27, 2025 03:33
@jbampton jbampton force-pushed the add-auto-docs-for-hooks branch from 9da33b1 to 647e435 Compare July 28, 2025 11:12
@github-actions github-actions bot removed the github label Jul 28, 2025
@jbampton jbampton marked this pull request as ready for review July 28, 2025 11:23
@jbampton jbampton marked this pull request as draft December 6, 2025 13: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.

1 participant