8000 Make gemini ignore `Lib/**` by ShaharNaveh · Pull Request #5903 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content

Make gemini ignore Lib/** #5903

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

Merged
merged 3 commits into from
Jul 4, 2025
Merged

Conversation

ShaharNaveh
Copy link
Contributor
@ShaharNaveh ShaharNaveh commented Jul 4, 2025

https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github#custom-configuration
Hopefully this works

Summary by CodeRabbit

  • Chores
    • Introduced a configuration file to specify ignore patterns for files and directories.

Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

Copy link
Contributor
coderabbitai bot commented Jul 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new configuration file .gemini/config.yaml has been added. This file introduces an ignore_patterns setting, specifying that all files and directories under any Lib directory should be ignored.

Changes

File(s) Change Summary
.gemini/config.yaml Added new config file with ignore pattern Lib/**

Possibly related PRs

Poem

In the warren, a config appears anew,
Telling the system what not to do.
“Ignore the Libs, keep paths so light,”
Our code hops forward, pure and bright!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a387f7 and c06d611.

📒 Files selected for processing (1)
  • .gemini/config.yaml (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.gemini/config.yaml (1)

1-2: Consider also ignoring the generated pylib/** directory.

Long-term project guidance states that pylib/** is auto-generated and should not be hand-edited. Adding it here would future-proof Gemini behaviour and avoid accidental review noise.

 ignore_patterns:
   - "Lib/**"
+  - "pylib/**"
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94a55eb and 31497f7.

📒 Files selected for processing (1)
  • .gemini/config.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to Lib/**/*.py : Minimize modifications to CPython standard library files in the `Lib/` directory
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to pylib/** : Do not modify the `pylib/` directory directly - its contents are generated automatically
.gemini/config.yaml (2)
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to Lib/**/*.py : Minimize modifications to CPython standard library files in the `Lib/` directory
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to pylib/** : Do not modify the `pylib/` directory directly - its contents are generated automatically
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Check the WASM package and demo
  • GitHub Check: Run snippets and cpython tests on wasm-wasi
  • GitHub Check: Run snippets and cpython tests (ubuntu-latest)
  • GitHub Check: Run rust tests (macos-latest)
  • GitHub Check: Run snippets and cpython tests (windows-latest)
  • GitHub Check: Run snippets and cpython tests (macos-latest)
  • GitHub Check: Run rust tests (windows-latest)
  • GitHub Check: Check Rust code with rustfmt and clippy
  • GitHub Check: Run rust tests (ubuntu-latest)
  • GitHub Check: Ensure compilation on various targets
🔇 Additional comments (1)
.gemini/config.yaml (1)

1-2: Config path & syntax look correct.

.gemini/config.yaml is the expected location and the YAML structure matches the public docs, so Gemini should pick this up without problems.

@ShaharNaveh
Copy link
Contributor Author

@coderabbitai can you please add your nitpick comment to this branch?

Copy link
Contributor
coderabbitai bot commented Jul 4, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

I'll examine the configuration file to provide you with thorough feedback.

After examining the configuration file, I can see it's a simple YAML file with an ignore pattern for Lib/**. Here are my nitpick comments:

@ShaharNaveh The configuration looks good overall and aligns well with the retrieved learnings about minimizing modifications to CPython standard library files in the Lib/ directory. However, here are some observations and suggestions:

Nitpick Comments:

  1. YAML formatting consistency: The configuration uses a simple structure, but you might want to consider adding a comment at the top to explain the purpose of this configuration file for future maintainers.

  2. Pattern specificity: The Lib/** pattern is appropriate, but you might want to verify that this pattern syntax is correct for Gemini's configuration. Different tools use different glob patterns (some use Lib/ vs Lib/**).

  3. Missing documentation: Consider adding a brief comment in the YAML file explaining why Lib/** is ignored, referencing that these are CPython standard library files that should remain unmodified.

  4. Future extensibility: The current structure allows for easy addition of more ignore patterns if needed.

Here's a suggested improvement:

# Gemini Code Assist configuration
# Ignore CPython standard library files to prevent modifications
ignore_patterns:
  - "Lib/**"

The configuration effectively addresses the need to prevent Gemini from suggesting modifications to CPython standard library files, which aligns perfectly with the project's guidelines about minimizing changes to the Lib/ directory.

  /|   /|   
 ( :v:  )
  |(_)|
   ^ ^

🏁 Script executed:

#!/bin/bash
# Read the contents of the Gemini configuration file
cat .gemini/config.yaml

Length of output: 55


@ShaharNaveh Here are my nitpick comments on the .gemini/config.yaml configuration:

Nitpick Comments:

  1. Missing documentation: The configuration file lacks any comments explaining why Lib/** is being ignored. This could be confusing for future contributors who might not understand the reasoning.

  2. YAML style consistency: While the current format is valid, adding a top-level comment would improve maintainability.

  3. Pattern validation: The Lib/** pattern should work correctly for Gemini's ignore functionality, matching the recursive directory structure.

Suggested improvement:

# Gemini Code Assist configuration
# Ignore CPython standard library files in Lib/ directory to prevent unwanted modifications
# as these should remain synchronized with upstream CPython
ignore_patterns:
  - "Lib/**"

Positive aspects:

  • ✅ Correctly uses YAML array syntax
  • ✅ Proper glob pattern for recursive directory matching
  • ✅ Aligns with project guidelines about minimizing Lib/ directory modifications
  • ✅ Clean and minimal configuration

The configuration effectively achieves its goal of preventing Gemini from suggesting changes to CPython standard library files, which is exactly what you want based on the retrieved learnings about the Lib/ directory.

   /|   /|   
  ( ^.^ )
   |(_)|
    ^ ^

🧠 Learnings used
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to Lib/test/**/*.py : Add a `# TODO: RUSTPYTHON` comment when modifications are made to tests in `Lib/test`

Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to Lib/test/**/*.py : Use `unittest.skip("TODO: RustPython <reason>")` or `unittest.expectedFailure` with `# TODO: RUSTPYTHON <reason>` comment in test files when skipping or marking expected failures

Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to Lib/**/*.py : Minimize modifications to CPython standard library files in the `Lib/` directory

Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T10:08:48.851Z
Learning: Applies to pylib/** : Do not modify the `pylib/` directory directly - its contents are generated automatically

Copy link
Member
@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

Thank you, let's try

@youknowone youknowone added the skip:ci Skip running the ci label Jul 4, 2025
@youknowone youknowone merged commit f57f6d7 into RustPython:main Jul 4, 2025
11 of 12 checks passed
@ShaharNaveh ShaharNaveh deleted the gemini-ignore-lib branch July 5, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip:ci Skip running the ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0