-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
feat(cli): Add CLI flags for controlling output sections and content processing #236
Conversation
Run & review this pull request in StackBlitz Codeflow. |
📝 WalkthroughWalkthroughThis pull request introduces new command-line options for the Repomix tool to enhance output configurability. The changes span across multiple files, including Changes
Possibly related PRs
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #236 +/- ##
==========================================
+ Coverage 92.20% 92.26% +0.05%
==========================================
Files 44 44
Lines 2090 2106 +16
Branches 458 462 +4
==========================================
+ Hits 1927 1943 +16
Misses 163 163 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/cli/actions/defaultAction.ts (1)
127-129
: Handle unexpected blank lines.Removing empty lines can sometimes introduce unintended concatenations, especially in files where line breaks are syntactically meaningful. Confirm that existing tests catch such edge cases.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md
(1 hunks)src/cli/actions/defaultAction.ts
(1 hunks)src/cli/cliRun.ts
(2 hunks)tests/cli/actions/defaultAction.test.ts
(1 hunks)
🔇 Additional comments (14)
src/cli/cliRun.ts (2)
29-32
: Add default values or handle undefined states.
While these optional booleans provide flexibility, consider explicitly setting default values or handling undefined states. This ensures predictable behavior when the user doesn’t pass these flags.
49-52
: Ensure consistent naming and usage.
These CLI options follow a negative/affirmative pattern (--no-...
versus --remove-...
). Confirm that this approach remains intuitive for users. Documentation in the README appears clear, but double-check for any inconsistent references.
src/cli/actions/defaultAction.ts (3)
118-120
: Good practice in handling fileSummary.
This check mirrors standard CLI patterns. The condition sets fileSummary
in the output object. The approach is consistent.
121-123
: Consistent approach for directoryStructure.
Same pattern as fileSummary
. Ensures clarity when turning directory structure on or off.
124-126
: Validate removal logic for comments.
Removing comments may affect certain file types that rely on doc comments. Ensure that your removal logic won’t break docstring-based frameworks or tools.
tests/cli/actions/defaultAction.test.ts (8)
166-185
: Comprehensive test coverage for --no-file-summary.
These tests accurately confirm that the fileSummary
flag is set to false
. Well done.
186-203
: Comprehensive test coverage for --file-summary.
These tests ensure fileSummary
is set to true
when specified. This consistency between the test and the CLI logic is good.
205-223
: Thorough testing of --no-directory-structure.
Checks are aligned with the condition in the CLI config. Good job verifying the merged config.
224-241
: Ensure directoryStructure is tested for both states.
The explicit test for true
helps to confirm correct behavior. Looks consistent.
243-261
: Validate comment removal.
This test suite ensures removeComments: true
is passed along. Confirm that underlying logic handles multiple file types properly.
262-279
: Confirm no-remove-comments usage.
Testing the false
scenario helps avoid regression. Reassuring coverage for toggling behavior.
281-299
: Check the removeEmptyLines implementation.
These tests adequately verify that removeEmptyLines
is set to true
. Evaluate logs or code coverage to confirm this code path runs for a variety of file formats.
300-317
: Thorough coverage of no-remove-empty-lines.
Again, specifying false
ensures that empty lines remain intact. Good job covering both states.
README.md (1)
315-318
: Clear explanation of new flags.
These lines in the documentation provide excellent clarity on the new flags. They match the CLI code changes and should reduce confusion for users.
This pull request adds new CLI flags to provide users with more control over the structure and content of Repomix output. These flags allow users to:
ref
#206 (comment)
Checklist
npm run test
npm run lint