Skip to content

fix: (some minor improvements to configs and getPackageJson return behaviour) - #12510

Merged
scidomino merged 19 commits into
google-gemini:mainfrom
grMLEqomlkkU5Eeinz4brIrOVCUCkJuN:fix/code-quality-improvements
Nov 24, 2025
Merged

fix: (some minor improvements to configs and getPackageJson return behaviour)#12510
scidomino merged 19 commits into
google-gemini:mainfrom
grMLEqomlkkU5Eeinz4brIrOVCUCkJuN:fix/code-quality-improvements

Conversation

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor

Summary

This PR fixes three minor things identified during code review:

  1. Removes duplicate .integration-tests/** ignore pattern in ESLint config
  2. Removes redundant side-effect import in CLI entry point (was this intentional?)
  3. Adds JSDoc documentation to clarify getPackageJson return behavior

These are minor cleanup fixes that improve code maintainability without changing functionality.

Details

  • ESLint config: Removed duplicate .integration-tests/** entry from the ignores array (was listed twice on lines 32 and 37)
  • CLI entry point: Removed unnecessary side-effect import import './src/gemini.js' since we're already importing main from the same file
  • Package utility: Added JSDoc to getPackageJson explaining that returning undefined is expected behavior when no package.json exists in the directory hierarchy, and removed the TODO comment. (like all the chaining is already there, why not just make use of it?)

Related Issues

N/A - Just minor improvements

How to Validate

  1. ESLint config: Verify ESLint still works correctly by running npm run lint
  2. CLI entry: Verify the CLI still starts correctly:
    • npm run start should launch the CLI without errors
    • npm run build && npm run start should work in production build
  3. Package utility: Verify the JSDoc appears correctly in IDE tooltips and the function still works:
    • Check that getPackageJson can be called and returns undefined when appropriate
    • Verify existing usages (e.g., packages/cli/src/utils/version.ts, packages/core/src/utils/channel.ts) still work correctly

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
    • JSDoc added to function
  • Added/updated tests (if needed)
    • No tests needed - these are code quality fixes that don't change behavior
  • Noted breaking changes (if any)
    • No breaking changes
  • Validated on required platforms/methods:
    • These are code quality fixes that don't require platform-specific validation
    • ESLint config change can be validated with npm run lint
    • Import removal is safe as it's a redundant side-effect import

@google-cla

google-cla Bot commented Nov 4, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @grMLEqomlkkU5Eeinz4brIrOVCUCkJuN, 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 minor code quality enhancements identified during a code review. The changes improve the maintainability and clarity of the codebase by removing redundancies and adding essential documentation, all without introducing any functional alterations.

Highlights

  • ESLint Configuration Cleanup: Removed a duplicate ignore pattern for .integration-tests/** from the ESLint configuration, streamlining the linting setup.
  • CLI Entry Point Optimization: Eliminated a redundant side-effect import in the CLI's main entry file, as the main function was already being imported from the same module.
  • Improved Package Utility Documentation: Added JSDoc to the getPackageJson function to clearly explain its return behavior, particularly that undefined is an expected result when no package.json is found in the directory hierarchy, and removed a related TODO comment.
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 set of minor but positive code quality enhancements. The changes, including removing a duplicate ESLint ignore pattern, eliminating a redundant import, and improving documentation for getPackageJson, are all well-executed and improve the maintainability of the codebase. The changes are correct and I have no further feedback.

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN grMLEqomlkkU5Eeinz4brIrOVCUCkJuN changed the title Fix/code quality improvements fix: (some minor improvements to configs and getPackageJson return behaviour) Nov 4, 2025
@scidomino
scidomino enabled auto-merge November 21, 2025 00:30
@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor Author

Ah... welp do i need to make changes @scidomino ?

auto-merge was automatically disabled November 21, 2025 05:27

Head branch was pushed to by a user without write access

@scidomino

Copy link
Copy Markdown
Collaborator

Please resolve the lint error. I don't understand what you are doing to CONTRIBUTING.md but somehow it's being flagged.

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor Author

Please resolve the lint error. I don't understand what you are doing to CONTRIBUTING.md but somehow it's being flagged.

I removed a "return" character that was somehow added in there (looking at my command line history it seems that after running a linter it added that there)

sorry for the headaches

@scidomino

Copy link
Copy Markdown
Collaborator

I still see the lint error. There is a way to run the linter locally I think. Alternatively, just revert the changes to that shortcut entirely.

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor Author

I still see the lint error. There is a way to run the linter locally I think. Alternatively, just revert the changes to that shortcut entirely.

Sorry, I had 0 clue why that was happening.

I apologize for the troubles

@scidomino

Copy link
Copy Markdown
Collaborator

The error is in docs/CONTRIBUTING.md. Revert that file change and everything should work.

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor Author

The error is in docs/CONTRIBUTING.md. Revert that file change and everything should work.

Right away, Also I found the error, I clone it on windows and somehow the file stopped becoming a symbolic link, it wasn't the linter at all (the reason why i thought it was the linter was because I noticed that somehow after running prettier, it was the last time git tracked it as the correct file)

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor Author

git refuses to let me restore the symlink, even when restoring the commit directly. (windows isue?)

auto-merge was automatically disabled November 24, 2025 19:42

Head branch was pushed to by a user without write access

@scidomino
scidomino enabled auto-merge November 24, 2025 19:44
@scidomino

Copy link
Copy Markdown
Collaborator

I removed it. Merging now.

@grMLEqomlkkU5Eeinz4brIrOVCUCkJuN

Copy link
Copy Markdown
Contributor Author

I removed it. Merging now.

Sorry, mate 😢I hope I didn't cause too much trouble.

@scidomino

Copy link
Copy Markdown
Collaborator

I removed it. Merging now.

Sorry, mate 😢I hope I didn't cause too much trouble.

No worries. Git and windows caused the trouble, not you.

@scidomino
scidomino added this pull request to the merge queue Nov 24, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 24, 2025
@scidomino
scidomino added this pull request to the merge queue Nov 24, 2025
Merged via the queue into google-gemini:main with commit d53a5c4 Nov 24, 2025
21 checks passed
kimjune01 added a commit to kimjune01/gemini-cli-claude that referenced this pull request Nov 24, 2025
Merge latest upstream changes from google-gemini/gemini-cli main branch.

## Merge Conflict Resolution

**File:** packages/core/src/services/chatCompressionService.ts

**Conflict:** Both branches modified the compression service API:
- main: Migrated to new model config system (getBaseLlmClient, modelConfigKey)
- feat/deliberate-compaction: Added goal-focused compression (userGoal parameter)

**Resolution:** Combined both changes:
- Used new model config API from main (getBaseLlmClient, modelStringToModelConfigAlias, abortSignal)
- Preserved goal-focused enhancement (getChatCompressionPrompt(userGoal))
- Result: New API + goal awareness working together

**Additional Changes:**
- Updated chatCompressionService.test.ts to use new BaseLlmClient API
- Changed all test mocks from getContentGenerator to getBaseLlmClient
- Added BaseLlmClient import and proper type casts
- Fixed linting: changed messagesPreserved/messagesCompressed to const
- Build passes successfully

## Upstream Changes Merged

From google-gemini/gemini-cli main (95693e2..d14779b):
- feat(core): Land bool for alternate system prompt (google-gemini#13764)
- feat(hooks): Hook Agent Lifecycle Integration (google-gemini#9105)
- feat(hooks): Hook Event Handling (google-gemini#9097)
- fix: Minor improvements to configs and getPackageJson (google-gemini#12510)
- feat(hooks): Hook Telemetry Infrastructure (google-gemini#9082)
- feat(core): Migrate chatCompressionService to model configs (google-gemini#12863)
- Add session subtask in /stats command (google-gemini#13750)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mboshernitsan pushed a commit that referenced this pull request Nov 25, 2025
…haviour) (#12510)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
thacio added a commit to thacio/auditaria that referenced this pull request Nov 26, 2025
danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
…haviour) (google-gemini#12510)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
…haviour) (#12510)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
@sripasg sripasg added the size/s A small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants