Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #406 +/- ##
==========================================
+ Coverage 57.22% 57.40% +0.18%
==========================================
Files 47 47
Lines 5543 5543
Branches 5543 5543
==========================================
+ Hits 3172 3182 +10
+ Misses 1337 1308 -29
- Partials 1034 1053 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the shebangs in two JavaScript example files and adds corresponding test coverage for non-shell script usage parsing. The changes correct the shebang from #!/usr/bin/env -S usage node to #!/usr/bin/env -S usage exec node to properly use the usage exec subcommand, and add execution tests to verify both the new bracketed syntax (// [USAGE]) and old syntax (//USAGE) work correctly with JavaScript files.
Key Changes
- Fixed shebangs in JavaScript examples to use
usage exec nodeinstead ofusage node - Updated comments in example files to clarify they are "non-shell script" tests
- Added two new test functions to verify JavaScript example execution
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| examples/test-usage-double-slash.js | Fixed shebang to use usage exec node and updated comment to specify "non-shell script" |
| examples/test-usage-double-slash-old.js | Fixed shebang to use usage exec node and updated comment to specify "non-shell script" |
| cli/tests/examples.rs | Added two execution tests for the JavaScript examples, verifying both new bracketed and old USAGE syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
bugbot run |
## [2.11.0](https://github.com/jdx/usage/compare/v2.10.0..v2.11.0) - 2025-12-31 ### 🚀 Features - add default_subcommand and restart_token for naked task completions by [@jdx](https://github.com/jdx) in [#410](#410) ### 🐛 Bug Fixes - handle --help flag in exec command for non-shell scripts by [@jdx](https://github.com/jdx) in [#409](#409) ### 🧪 Testing - add non-shell script tests by [@muzimuzhi](https://github.com/muzimuzhi) in [#406](#406) ### 📦️ Dependency Updates - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#403](#403) - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#407](#407) - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#408](#408)
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [usage](https://github.com/jdx/usage) | minor | `2.10.0` → `2.11.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/usage (usage)</summary> ### [`v2.11.0`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2110---2025-12-31) [Compare Source](jdx/usage@v2.10.0...v2.11.0) ##### 🚀 Features - add default\_subcommand and restart\_token for naked task completions by [@​jdx](https://github.com/jdx) in [#​410](jdx/usage#410) ##### 🐛 Bug Fixes - handle --help flag in exec command for non-shell scripts by [@​jdx](https://github.com/jdx) in [#​409](jdx/usage#409) ##### 🧪 Testing - add non-shell script tests by [@​muzimuzhi](https://github.com/muzimuzhi) in [#​406](jdx/usage#406) ##### 📦️ Dependency Updates - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​403](jdx/usage#403) - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​407](jdx/usage#407) - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​408](jdx/usage#408) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuNjkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Fixes the shebangs in two JavaScript examples added by #377, and add usage tests for them.
Note that no
--helptests were added, due toNote
Adds coverage for non-shell script
// [USAGE]and legacy//USAGEparsing/execution and corrects JS example shebangs.cli/tests/examples.rsexecute Node examples viausage exec node, asserting parsed flags/args and defaultsexamples/test-usage-double-slash.jsand...-old.jsshebangs to#!/usr/bin/env -S usage exec nodeand refine commentsWritten by Cursor Bugbot for commit 967b94e. This will update automatically on new commits. Configure here.