Skip to content

Conversation

@chalmerlowe
Copy link
Contributor

This PR updates the conf.py templates to suppress the "Bullet list ends without a blank line" warning from Sphinx.

This warning often appears in generated documentation where strict adherence to blank lines after bullet lists is not always feasible or necessary. To reduce noise in the build logs, a custom logging filter is added to the Sphinx configuration.

Changes:

  • Updates:
    • gapic/templates/docs/conf.py.j2 and
    • gapic/ads-templates/docs/conf.py.j2
  • Adds UnexpectedUnindentFilter, a custom logging.Filter class, to catch warnings containing the message "Bullet list ends without a blank line".
  • Registers this filter with the sphinx logger in the setup() function.

@chalmerlowe chalmerlowe requested a review from a team as a code owner January 23, 2026 14:26
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jan 23, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chalmerlowe, 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 aims to streamline the Sphinx documentation build process by eliminating a common, often non-critical, warning related to bullet list formatting. By integrating a custom logging filter directly into the conf.py templates, the change ensures that build logs remain focused on more significant issues, thereby enhancing the developer experience and build output readability without altering the documentation content itself.

Highlights

  • Warning Suppression: Implemented a mechanism to suppress the 'Bullet list ends without a blank line' warning from Sphinx build logs, reducing noise and improving log clarity.
  • Custom Logging Filter: Introduced a new UnexpectedUnindentFilter class, inheriting from logging.Filter, specifically designed to intercept and filter out the aforementioned Sphinx warning.
  • Configuration Template Updates: Applied these changes to both gapic/templates/docs/conf.py.j2 and gapic/ads-templates/docs/conf.py.j2 to ensure consistent warning suppression across generated documentation.
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 conf.py.j2 templates for Sphinx to suppress the 'Bullet list ends without a blank line' warning. This is achieved by adding a custom logging.Filter. The implementation is correct and follows standard Sphinx practices. I've provided a suggestion to make the filter logic more concise in both updated files.

Comment on lines +372 to +375
msg = record.getMessage()
if "Bullet list ends without a blank line" in msg:
return False
return True
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For conciseness, the logic in the filter method can be simplified to a single return statement.

        return "Bullet list ends without a blank line" not in record.getMessage()

Comment on lines +383 to +386
msg = record.getMessage()
if "Bullet list ends without a blank line" in msg:
return False
return True
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For conciseness, the logic in the filter method can be simplified to a single return statement.

        return "Bullet list ends without a blank line" not in record.getMessage()

@chalmerlowe
Copy link
Contributor Author

To whomever reviews this. I am curious about your feelings on the Gemini suggestions. I worry that the concise version suggested decreases readability by forcing some mental gymnastics over True, False, double negatives, etc.

@parthea parthea changed the title fix: updates conf.py.js templates to add sphinx warnings fix: filter sphinx warnings related to adding a new line after lists Jan 23, 2026
Comment on lines +368 to +375
class UnexpectedUnindentFilter(logging.Filter):
"""Filter out warnings about unexpected unindentation following bullet lists."""
def filter(self, record):
# Return False to suppress the warning, True to allow it
msg = record.getMessage()
if "Bullet list ends without a blank line" in msg:
return False
return True
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we include this (and the setup function below) in a separate file as a macro and use it in both templates and ad-templates? I'm guessing we'll keep introducing new code for each warning as per this pattern and it'll be easier to maintain code if it's one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants