-
Notifications
You must be signed in to change notification settings - Fork 162
fix(lint): allow deprecation rule on deprecated descriptor #1570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lint): allow deprecation rule on deprecated descriptor #1570
Conversation
|
/gemini reivew |
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
|
It looks like you might have a typo in your command. Did you mean |
|
/gemini review |
There was a problem hiding this 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.
Extend the internal
descriptorDisableCheckssignature to include the rule name as a parameter. This allows such checks to make per-rule, per-aip, or per-group exceptions.Updates the
disableDeprecatedcheck to exempt"core::0192::deprecated-comment"from disablement ondeprecateddescriptors b.c the rule is designed to lintdeprecateddescriptors 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