Add metadata-only output mode with --no-files flag#491
Conversation
Deploying repomix with
|
| Latest commit: |
20b2027
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b05ee36c.repomix.pages.dev |
| Branch Preview URL: | https://feature-metadata-only-output.repomix.pages.dev |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
==========================================
+ Coverage 84.55% 84.57% +0.01%
==========================================
Files 88 88
Lines 4350 4362 +12
Branches 845 847 +2
==========================================
+ Hits 3678 3689 +11
- Misses 672 673 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@gemini review |
|
Okay, I will review the pull request. Thank you for requesting a review! |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new metadata-only output mode by adding the --no-files flag, which disables file content output and propagates the change throughout the CLI, configuration schemas, and various output formats.
- Updated documentation in both English and German
- Extended tests to cover both the explicit --no-files and files-enabled behaviors
- Integrated flag handling in configuration, output generation, and CLI options
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/client/src/en/guide/command-line-options.md | Added description for the --no-files flag |
| website/client/src/de/guide/command-line-options.md | Added German description for the --no-files flag |
| tests/mcp/tools/packCodebaseTool.test.ts | Added files flag handling in test configuration |
| tests/integration-tests/packager.test.ts | Updated integration tests to handle metadata-only output mode |
| tests/core/treeSitter/parseFile.solidity.test.ts | Adjusted output file path and added files flag in tests |
| tests/core/output/outputStyles/markdownStyle.test.ts | Updated markdown style test to include filesEnabled option |
| tests/core/output/outputGenerate.test.ts | Added filesEnabled test configuration |
| tests/config/configSchema.test.ts | Added files flag to config schema tests |
| tests/cli/cliRun.test.ts | Updated CLI run tests with files flag |
| tests/cli/actions/defaultAction.test.ts | Added tests for handling --no-files and explicit files flags |
| src/core/output/outputStyles/xmlStyle.ts | Added conditional markup for files section when enabled |
| src/core/output/outputStyles/plainStyle.ts | Added conditional block for files section in plain style |
| src/core/output/outputStyles/markdownStyle.ts | Included filesEnabled section in markdown template |
| src/core/output/outputStyleDecorate.ts | Updated documentation to include repository files section |
| src/core/output/outputGeneratorTypes.ts | Extended RenderContext with filesEnabled property |
| src/core/output/outputGenerate.ts | Conditioned files output based on filesEnabled flag |
| src/config/configSchema.ts | Updated config schema to include and default the files flag |
| src/cli/types.ts | Added files property to CLI options type |
| src/cli/cliRun.ts | Added --no-files CLI option |
| src/cli/actions/defaultAction.ts | Configured CLI action to update output.files when explicitly set to false |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new --no-files flag to disable the output of file contents, enabling a metadata-only mode. The changes are well-structured and cover the necessary modifications across the CLI, configuration, core logic, and tests. The addition of this feature enhances the tool's flexibility by allowing users to generate output focused solely on metadata, which can be useful in various scenarios.
Merge Readiness
The pull request appears to be in good shape for merging. All requested changes have been addressed, and the new feature is well-integrated with existing functionality. However, it's always a good idea to have another team member review the changes before merging, as I am unable to approve the pull request. The addition of the --no-files flag and associated functionality seems to be well-implemented and tested. I recommend merging this pull request after another review.
There was a problem hiding this comment.
Pull Request Overview
This PR implements a metadata-only output mode that disables file content output using the new --no-files flag. Key changes include:
- Documentation updates in both English and German guides for the new CLI flag.
- Updates to test cases across unit, integration, and configuration files to incorporate the new files flag.
- Modifications in output generation templates, configuration schemas, and CLI handling to support the files flag.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/client/src/en/guide/command-line-options.md | Added documentation for --no-files flag (metadata-only mode) |
| website/client/src/de/guide/command-line-options.md | Same as English, added German documentation for --no-files flag |
| tests/mcp/tools/packCodebaseTool.test.ts | Updated test config to include the files flag |
| tests/integration-tests/packager.test.ts | Modified tests to conditionally verify XML/plain text outputs with files flag |
| tests/core/treeSitter/parseFile.solidity.test.ts | Updated filePath and added files flag into test config |
| tests/core/output/outputStyles/* | Modified templates to conditionally display file content based on filesEnabled flag |
| tests/core/output/outputGenerate.test.ts | Added filesEnabled flag in test data |
| tests/config/configSchema.test.ts | Updated config tests to include the files flag |
| tests/cli/cliRun.test.ts | Updated CLI tests to handle the new files flag |
| tests/cli/actions/defaultAction.test.ts | Added tests to verify CLI handling of --no-files and explicit --files flag |
| src/core/output/outputGeneratorTypes.ts | Added a new filesEnabled property to the RenderContext interface |
| src/core/output/outputGenerate.ts | Integrated filesEnabled flag in XML output generation |
| src/config/configSchema.ts | Added the files property to the configuration schema |
| src/cli/types.ts | Extended CLI options to include the files flag |
| src/cli/cliRun.ts | Registered the new --no-files flag in the CLI command setup |
| src/cli/actions/defaultAction.ts | Added logic to override files flag when explicitly set to false |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThis change introduces a new configurable option, Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant ConfigLoader
participant OutputGenerator
participant Renderer
User->>CLI: Run command with or without --no-files
CLI->>ConfigLoader: Load and merge config (includes files flag)
ConfigLoader-->>CLI: Merged config with output.files
CLI->>OutputGenerator: Generate output with config
OutputGenerator->>Renderer: Render output (filesEnabled flag)
alt filesEnabled is true
Renderer->>OutputGenerator: Include files content in output
else filesEnabled is false
Renderer->>OutputGenerator: Omit files content from output
end
OutputGenerator-->>CLI: Output result
CLI-->>User: Display or save output
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
tests/core/output/outputGenerate.test.ts (1)
1-136: Add a test for metadata‑only mode (--no-files).
To fully cover the new behavior, consider adding a test case wherefilesEnabled: falseis returned frombuildOutputGeneratorContext, and assert that the generated output omits file content sections.website/client/src/fr/guide/command-line-options.md (1)
15-15: Formatting adjustment needed for French typography standards.The documentation correctly explains the new
--no-filescommand-line option for metadata-only output mode. However, there are two minor formatting issues according to French typographical standards:
- There should be an unbreakable space before the colon in "(par défaut:
true)"- The apostrophe character should be the curved French apostrophe
- - `--no-files`: Désactiver la sortie du contenu des fichiers (mode métadonnées uniquement) (par défaut: `true`) + - `--no-files`: Désactiver la sortie du contenu des fichiers (mode métadonnées uniquement) (par défaut : `true`)🧰 Tools
🪛 LanguageTool
[uncategorized] ~15-~15: Les deux-points sont précédés d’une espace insécable.
Context: ...iers (mode métadonnées uniquement) (par défaut:true) ---remove-comments: Supprime...(FRENCH_WHITESPACE)
[typographical] ~15-~15: Caractère d’apostrophe incorrect.
Context: ...de métadonnées uniquement) (par défaut:true) ---remove-comments: Supprimer les c...(APOS_INCORRECT)
tests/integration-tests/packager.test.ts (1)
129-152: Improved test strategy for output verificationThe new approach is more robust than direct string comparison, verifying key elements while accommodating the conditional inclusion of file contents based on the new
filesflag.Two suggestions:
- Consider translating the Japanese comments to English for consistency
- Consider adding a test case with
files: falseto verify that behavior- // Compare the outputs - XMLとプレーンテキストで異なる場合は条件分岐 + // Compare the outputs - Different checks for XML and plain text formats expect(actualOutput).toContain('This file is a merged representation of the entire codebase'); if (config.output?.style === 'xml') { - // XML形式のテスト + // Test for XML format expect(actualOutput).toContain('<file_summary>'); expect(actualOutput).toContain('<directory_structure>'); expect(actualOutput).toContain('resources/'); expect(actualOutput).toContain('src/'); expect(actualOutput).toContain('<file path="src/index.js">'); expect(actualOutput).toContain('function main() {'); expect(actualOutput).toContain('<file path="src/utils.js">'); expect(actualOutput).toContain('function greet(name) {'); } else { - // プレーンテキスト形式のテスト + // Test for plain text format expect(actualOutput).toContain('File Summary'); expect(actualOutput).toContain('Directory Structure'); expect(actualOutput).toContain('resources/'); expect(actualOutput).toContain('src/'); expect(actualOutput).toContain('File: src/index.js'); expect(actualOutput).toContain('function main() {'); expect(actualOutput).toContain('File: src/utils.js'); expect(actualOutput).toContain('function greet(name) {'); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
src/cli/actions/defaultAction.ts(1 hunks)src/cli/cliRun.ts(1 hunks)src/cli/types.ts(1 hunks)src/config/configSchema.ts(2 hunks)src/core/output/outputGenerate.ts(2 hunks)src/core/output/outputGeneratorTypes.ts(1 hunks)src/core/output/outputStyleDecorate.ts(1 hunks)src/core/output/outputStyles/markdownStyle.ts(2 hunks)src/core/output/outputStyles/plainStyle.ts(2 hunks)src/core/output/outputStyles/xmlStyle.ts(2 hunks)tests/cli/actions/defaultAction.test.ts(2 hunks)tests/cli/cliRun.test.ts(2 hunks)tests/config/configSchema.test.ts(3 hunks)tests/core/output/outputGenerate.test.ts(1 hunks)tests/core/output/outputStyles/markdownStyle.test.ts(1 hunks)tests/core/treeSitter/parseFile.solidity.test.ts(2 hunks)tests/integration-tests/packager.test.ts(1 hunks)tests/mcp/tools/packCodebaseTool.test.ts(1 hunks)website/client/src/de/guide/command-line-options.md(1 hunks)website/client/src/en/guide/command-line-options.md(1 hunks)website/client/src/es/guide/command-line-options.md(1 hunks)website/client/src/fr/guide/command-line-options.md(1 hunks)website/client/src/ja/guide/command-line-options.md(1 hunks)website/client/src/ko/guide/command-line-options.md(1 hunks)website/client/src/pt-br/guide/command-line-options.md(1 hunks)website/client/src/zh-cn/guide/command-line-options.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
website/client/src/fr/guide/command-line-options.md
[uncategorized] ~15-~15: Les deux-points sont précédés d’une espace insécable.
Context: ...iers (mode métadonnées uniquement) (par défaut: true) - --remove-comments: Supprime...
(FRENCH_WHITESPACE)
[typographical] ~15-~15: Caractère d’apostrophe incorrect.
Context: ...de métadonnées uniquement) (par défaut: true) - --remove-comments: Supprimer les c...
(APOS_INCORRECT)
🪛 GitHub Check: codecov/patch
src/core/output/outputGenerate.ts
[warning] 81-81: src/core/output/outputGenerate.ts#L81
Added line #L81 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (30)
website/client/src/zh-cn/guide/command-line-options.md (1)
15-15: Documentation updated with--no-filesflag.
Translation accurately reflects the new CLI option for disabling file content output in metadata‑only mode, and the default value is clearly stated.src/core/output/outputStyleDecorate.ts (1)
106-106: Summary section updated to include repository files.
The new list item “4. Repository files (if enabled)” correctly aligns the summary with thefilesEnabledfeature. The enumeration and formatting are consistent.website/client/src/pt-br/guide/command-line-options.md (1)
15-15: Portuguese docs include--no-files.
The translation accurately describes the new metadata‑only flag and its default setting.website/client/src/ko/guide/command-line-options.md (1)
15-15: Korean docs include--no-files.
The description correctly reflects the metadata‑only flag and default value, matching other locales.tests/core/output/outputGenerate.test.ts (1)
39-39: Mock context now includesfilesEnabled.
The test correctly mocks the newfilesEnabledproperty to validate that file‑content rendering is gated by this flag.website/client/src/es/guide/command-line-options.md (1)
15-15: Documentation added for the new--no-filesflag looks good!The Spanish translation is clear and follows the same format as other command-line options in the documentation.
website/client/src/ja/guide/command-line-options.md (1)
15-15: Documentation added for the new--no-filesflag looks good!The Japanese translation is clear and follows the same format as other command-line options in the documentation.
website/client/src/en/guide/command-line-options.md (1)
15-15: Documentation added for the new--no-filesflag looks good!The English description is clear and follows the same format as other command-line options in the documentation.
src/cli/types.ts (1)
17-17: The newfilesproperty is correctly implemented in the CliOptions interface.The property is appropriately placed in the "Output Options" section of the interface, matching the documentation changes.
tests/cli/cliRun.test.ts (2)
72-72: LGTM! Test configuration updated correctly.The test mock configuration has been properly updated to include the new
filesproperty, ensuring tests reflect the newly added feature.
116-116: LGTM! Remote action test configuration updated correctly.The test mock configuration for remote actions has been properly updated to include the new
filesproperty, maintaining consistency with the feature changes.website/client/src/de/guide/command-line-options.md (1)
15-15: LGTM! German documentation properly updated.The German translation of the new
--no-filesoption is accurate and correctly explains its purpose as a metadata-only mode.tests/core/output/outputStyles/markdownStyle.test.ts (1)
34-35: LGTM! Test data properties added for new feature.Correctly added the
filesEnabledflag to test data to support the new feature for metadata-only output mode. ThemarkdownCodeBlockDelimiterproperty is also appropriately included to ensure proper markdown rendering.tests/core/treeSitter/parseFile.solidity.test.ts (2)
11-11: Updated output path to be consistent with other tests.The output file path has been updated from 'repomix-output.xml' to 'output.txt', which helps maintain consistency across test files.
22-22: Added support for the new files configuration option.The test configuration now properly includes the new
filesproperty set totrue, which aligns with the newly introduced metadata-only output mode feature.tests/mcp/tools/packCodebaseTool.test.ts (1)
69-69: Added support for the new files configuration option.The mock object correctly includes the new
files: trueproperty in the output configuration, ensuring the tests properly reflect the updated configuration schema with the new metadata-only output mode feature.src/core/output/outputStyles/plainStyle.ts (1)
51-63: Implemented conditional rendering of file contents.The "Files" section of the template is now conditionally rendered based on the
filesEnabledflag, which correctly implements the metadata-only output mode feature when the--no-filesflag is used.src/core/output/outputGeneratorTypes.ts (1)
24-24: Added filesEnabled property to RenderContext interface.The new readonly boolean property
filesEnabledhas been added to theRenderContextinterface, following the same pattern as existing properties likefileSummaryEnabledanddirectoryStructureEnabled. This property is essential for conditionally rendering file contents in output templates.src/cli/cliRun.ts (1)
60-60: LGTM! New CLI option properly added.The
--no-filesoption is correctly implemented and well documented with an appropriate description. It fits nicely with the other output control flags like--no-file-summaryand--no-directory-structure.src/core/output/outputStyles/markdownStyle.ts (1)
39-49: LGTM! Conditional rendering properly implemented.The Handlebars conditional is correctly implemented to wrap the entire "Files" section, including the header and file content blocks. This ensures the section is only rendered when
filesEnabledis true.src/core/output/outputStyles/xmlStyle.ts (1)
46-57: LGTM! Conditional XML section correctly implemented.The conditional rendering for the XML output is properly implemented, matching the pattern used in the markdown style. The entire
<files>section will be omitted whenfilesEnabledis false.src/cli/actions/defaultAction.ts (1)
169-175: LGTM! CLI option handling is consistent with other flags.The implementation correctly follows the established pattern for handling
--no-*flags in Commander.js. The option is only applied when explicitly set to false, which respects the config file values unless overridden by the CLI.tests/cli/actions/defaultAction.test.ts (2)
38-38: LGTM: Default configuration setup properly includes files optionThe mock configuration correctly includes the new
files: truedefault value, ensuring test consistency with the schema changes.
495-527: Well-structured tests for the new files flagThese tests properly verify both the
--no-filesflag and explicit--filesflag behavior, following the established pattern for boolean CLI options in this codebase.src/config/configSchema.ts (2)
26-26: LGTM: Appropriate schema addition for base configThe
filesboolean option is correctly added as optional in the base schema.
73-73: LGTM: Default value properly setThe
filesoption is appropriately configured with a default value oftruein the default schema.tests/config/configSchema.test.ts (3)
69-69: LGTM: Test case updated for new files optionThe test correctly includes the new
files: trueproperty in the valid default config test case.
85-85: Note: Ordering change for customPatternsThis change only modifies the formatting of the array, but doesn't impact functionality.
159-159: LGTM: Merged config test updatedThe test correctly includes the new
files: trueproperty in the valid merged config test case.src/core/output/outputGenerate.ts (1)
46-46: Good implementation of thefilesEnabledflagThe addition of the
filesEnabledflag to the render context correctly propagates the configuration option, following the same pattern as other feature flags in this function.
related:
Checklist
npm run testnpm run lint