-
Notifications
You must be signed in to change notification settings - Fork 8k
refactor: consolidate all flags to use hyphens (deprecate underscore flags) #3541
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
Conversation
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.
Summary of Changes
Hello @jackwotherspoon, 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 enhancing the consistency and maintainability of our command-line interface by standardizing flag naming conventions. The primary goal is to transition from underscore-separated flags to hyphen-separated flags, aligning with common CLI best practices. This change involves introducing new flags, deprecating old ones with clear guidance, and updating the underlying argument parsing to ensure backward compatibility during the transition phase.
Highlights
- CLI Flag Standardization: I've initiated a refactoring effort to standardize all CLI flags to use hyphens (
-
) instead of underscores (_
) for improved consistency across the application's command-line interface. - Deprecation Strategy: New hyphenated flags (e.g.,
--all-files
,--show-memory-usage
) have been introduced. The old underscore-based flags (--all_files
,--show_memory_usage
) are now deprecated and will display a warning message recommending the use of their hyphenated counterparts. These deprecated flags will be removed in future releases. - Internal Argument Handling: The internal argument parsing logic has been updated to recognize and prioritize the new hyphenated flag names. For a smooth transition, the system will continue to accept and correctly interpret the deprecated underscore flags during this interim period.
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 is currently in preview and 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 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
-
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. ↩
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 refactors the CLI flags to consistently use hyphens over underscores, deprecating the old underscore-based flags. The changes in config.ts
and sandboxConfig.ts
are well-implemented, correctly using yargs
to manage the new, old, and deprecated flags. The logic for handling both old and new flags ensures backward compatibility.
To complete this refactoring, I've identified two areas that need attention, which I consider high-priority for ensuring the quality and maintainability of this change:
-
Documentation (
high
severity): The command-line arguments documentation indocs/cli/configuration.md
needs to be updated to reflect these flag changes. It currently lists the old, deprecated flags (e.g.,--all_files
,--show_memory_usage
) and should be updated to feature the new hyphenated flags as the primary options. -
Testing (
high
severity): The unit tests inpackages/cli/src/config/config.test.ts
should be updated. The existing tests for flags likeshow_memory_usage
only cover the old, deprecated version. New tests are needed to verify the behavior of the new hyphenated flags and the precedence logic to prevent future regressions.
Addressing these points will make this a complete and robust change.
Code Coverage Summary
CLI Package - Full Text Report
Core Package - Full Text Report
For detailed HTML reports, please see the 'coverage-reports-22.x' artifact from the main CI run. |
Code Coverage Summary
CLI Package - Full Text Report
Core Package - Full Text Report
For detailed HTML reports, please see the 'coverage-reports-24.x' artifact from the main CI run. |
- Enables debug mode for this session, providing more verbose output. | ||
- **`--all_files`** (**`-a`**): |
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.
lmao we were monsters
@jackwotherspoon can you resolve the conflicts then we can merge this |
TLDR
Consolidate CLI flags to use hyphens (
-
) over underscores (_
) for consistency.To remove deprecated flags in a few releases.
Dive Deeper
Add new flags using hyphens, moved aliases to hyphen flags, deprecated old flags (to be removed in a couple releases)
Old flags will recommend usage of new flag with hyphen.
Reviewer Test Plan
Running
--help
on feature branch:Testing Matrix
Linked issues / bugs
Related to #3471