Skip to content

Conversation

@myzhan
Copy link
Contributor

@myzhan myzhan commented Oct 14, 2025

See: #806

@gemini-code-assist
Copy link

Summary of Changes

Hello @myzhan, 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 emmylua_doc_cli tool by providing more granular control over file selection for documentation generation. It introduces an --include option for explicit file inclusion and renames the --ignore option to --exclude for improved semantic clarity, while maintaining backward compatibility. These changes allow users to precisely define the scope of files to be processed, making the tool more flexible and powerful for various project structures.

Highlights

  • New CLI Option: --include: Introduced a new command-line option --include to specify a comma-separated list of glob patterns for files to be included in the documentation generation. This allows users to explicitly define which files should be processed.
  • Renamed CLI Option: --exclude (formerly --ignore): The existing --ignore command-line option has been renamed to --exclude for better clarity. --ignore is now a deprecated alias for --exclude, ensuring backward compatibility while promoting the new, more descriptive name.
  • Refactored File Pattern Matching Logic: The internal logic for collecting files has been updated to properly handle both include and exclude patterns. Explicit --include patterns, if provided, will override default inclusion rules, and --exclude patterns will always take precedence over include patterns.
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

@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 adds support for --include patterns to the emmylua_doc_cli tool, allowing users to specify which files to include in the documentation generation. It also renames the --ignore flag to --exclude for clarity, while maintaining backward compatibility by keeping --ignore as an alias. The changes are well-implemented across the command-line argument parsing, configuration loading, and file collection logic. My review focuses on improving code readability. I've suggested using more descriptive variable names in init.rs to make the code easier to understand and maintain.

Comment on lines +177 to +179
if let Some(p) = include_pattern {
include.extend(p);
} else {

Choose a reason for hiding this comment

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

medium

For better readability, consider using a more descriptive variable name than p. For example, patterns or include_patterns would make it clearer what the variable contains.

Suggested change
if let Some(p) = include_pattern {
include.extend(p);
} else {
if let Some(patterns) = include_pattern {
include.extend(patterns);
} else {

Comment on lines +202 to 205
if let Some(p) = exclude_pattern {
log::info!("Adding excludes from \"--exclude(or --ignore)\": {:?}", p);
exclude.extend(p);
}

Choose a reason for hiding this comment

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

medium

For better readability and consistency, consider using a more descriptive variable name than p. For example, patterns or exclude_patterns would make the code's intent clearer.

Suggested change
if let Some(p) = exclude_pattern {
log::info!("Adding excludes from \"--exclude(or --ignore)\": {:?}", p);
exclude.extend(p);
}
if let Some(patterns) = exclude_pattern {
log::info!("Adding excludes from \"--exclude(or --ignore)\": {:?}", patterns);
exclude.extend(patterns);
}

@CppCXY CppCXY merged commit 0888d13 into EmmyLuaLs:main Oct 14, 2025
22 checks passed
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