Skip to content

Conversation

@noahdietz
Copy link
Collaborator

Extend the internal descriptorDisableChecks signature to include the rule name as a parameter. This allows such checks to make per-rule, per-aip, or per-group exceptions.

Updates the disableDeprecated check to exempt "core::0192::deprecated-comment" from disablement on deprecated descriptors b.c the rule is designed to lint deprecated descriptors for appropriate deprecation comments.

Note: This could be perceived as a "surprise" to linter user when they start seeing complaints from this rule on elements that have already been checked in without such a comment or with a different style of deprecation comment. This is acceptable to me as it is 1. a bug fix 2. aligning with a style/format that was chosen for specific reasons in AIP-192.

Updates #1568

@noahdietz noahdietz requested a review from a team as a code owner November 21, 2025 19:25
@noahdietz
Copy link
Collaborator Author

/gemini reivew

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @noahdietz, 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 refines the linter's behavior concerning deprecated protocol buffer descriptors. Previously, all linting rules were automatically disabled for deprecated elements. This change introduces a mechanism to allow specific rules, particularly those designed to enforce best practices for deprecation (like ensuring proper deprecation comments as per AIP-192), to remain active on deprecated code. This ensures that even deprecated components adhere to defined style and format guidelines.

Highlights

  • Enhanced Deprecation Rule Handling: The internal descriptorDisableChecks signature has been extended to include the rule name as a parameter, allowing for more granular control over which rules are applied to deprecated descriptors.
  • Exemption for Deprecation Comment Rule: The disableDeprecated check now specifically exempts the core::0192::deprecated-comment rule from being disabled on deprecated descriptors. This ensures that the linter continues to enforce proper deprecation comments even on deprecated elements.
  • Improved Test Coverage: A new test case has been added to TestRuleIsEnabledDeprecated to verify that the core::0192::deprecated-comment rule remains enabled for deprecated fields, confirming the intended behavior.
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 correctly modifies the linter's rule-disabling logic to create an exception for the core::0192::deprecated-comment rule, allowing it to run on deprecated descriptors. The approach of extending the descriptorDisableChecks signature is sound, and the accompanying test updates effectively validate the new behavior. I have a couple of suggestions to enhance maintainability and test clarity.

@gemini-code-assist
Copy link
Contributor

It looks like you might have a typo in your command. Did you mean /gemini review? If so, please use the correct command to initiate a code review.

@noahdietz
Copy link
Collaborator Author

/gemini review

@noahdietz noahdietz requested a review from quirogas November 21, 2025 19:31
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 mechanism to allow specific linting rules to run on deprecated Protobuf descriptors, which are otherwise skipped. The core change is to pass the rule name to the disable-check functions, allowing for per-rule exceptions. The implementation correctly exempts the core::0192::deprecated-comment rule from being disabled on deprecated elements. The necessary function signatures and call sites have been updated consistently throughout the lint package. The tests have also been updated effectively to cover this new exception, including adding a new test case and fixing a minor issue in an existing test. The changes are well-executed and effectively address the issue described.

@noahdietz noahdietz merged commit f89a1b8 into googleapis:main Nov 21, 2025
5 checks passed
@noahdietz noahdietz deleted the deprecated-comment-disabled branch November 21, 2025 22:48
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