Update CLI to simplify arguments and improve defaults - #60
Conversation
Replaced `--folder` option with a positional argument for specifying paths. Changed the default behavior to check the current directory when no path is provided. Updated error handling to fail with a clear message and non-zero exit code when given paths do not exist. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert <jens@meiert.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review limit reached
Next review available in: 37 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe CLI now accepts an optional positional path, uses the current directory when no path is provided, and reports missing paths with a non-zero exit. Tests, documentation, changelog content, package version, and development dependencies were updated. ChangesCLI path argument update
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant obsohtmlCLI
participant Filesystem
User->>obsohtmlCLI: Provide optional positional path
obsohtmlCLI->>Filesystem: Resolve and check target path
Filesystem-->>obsohtmlCLI: Return path status
obsohtmlCLI->>User: Scan target or report error and exit
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bin/obsohtml.js`:
- Around line 100-106: Update the lstatSync error handling around
projectDirectory so both ENOENT and ENOTDIR are treated as unresolved targets,
printing the existing “No such file or directory” message and exiting instead of
rethrowing; add a regression test covering a path whose parent is an existing
file.
In `@README.md`:
- Around line 23-25: Update the README usage/output documentation to describe
that a nonexistent target path produces an error and exits with status 1. Revise
the status 0 description to specify that it indicates a successful scan found no
obsolete HTML, not an invalid or missing target.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 757eb7da-e8f3-47bd-8cdd-f904cc1fc4a0
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
CHANGELOG.mdREADME.mdbin/obsohtml.jsbin/obsohtml.test.jspackage.json
Added support to handle `ENOTDIR` errors similarly to `ENOENT` when a path is below an existing file. Updated tests to verify proper error messaging and ensure no raw stack traces are displayed. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert <jens@meiert.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the ObsoHTML CLI interface to use a positional path argument (defaulting to the current directory) and improves failure behavior when the target path cannot be resolved, alongside corresponding documentation, tests, and a major version bump.
Changes:
- Replaced the removed
-f/--folderoption with an optional positional[path]argument and defaulted to.when omitted. - Added explicit failure (non-zero exit + clearer message) for non-existent/unresolvable target paths, with updated CLI tests.
- Updated README/CHANGELOG and released as
2.0.0(plus minor devDependency bumps).
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates CLI usage text and examples for positional path + current-directory default. |
| package.json | Bumps version to 2.0.0 and updates devDependency patch versions. |
| package-lock.json | Locks updated devDependency versions and bumps lockfile package version to 2.0.0. |
| CHANGELOG.md | Documents breaking CLI argument change and new failure behavior for missing paths. |
| bin/obsohtml.test.js | Updates CLI tests for positional path, default-CWD behavior, and missing-path failures. |
| bin/obsohtml.js | Implements positional argument parsing and new missing/unresolvable target error handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary by CodeRabbit
-f/--folderoption.