Skip to content

Conversation

@muzimuzhi
Copy link
Contributor

@muzimuzhi muzimuzhi commented Dec 23, 2025

Fixes the shebangs in two JavaScript examples added by #377, and add usage tests for them.

Note that no --help tests were added, due to


Note

Adds coverage for non-shell script // [USAGE] and legacy //USAGE parsing/execution and corrects JS example shebangs.

  • New tests in cli/tests/examples.rs execute Node examples via usage exec node, asserting parsed flags/args and defaults
  • Update examples/test-usage-double-slash.js and ...-old.js shebangs to #!/usr/bin/env -S usage exec node and refine comments

Written by Cursor Bugbot for commit 967b94e. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 23, 2025 19:42
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.40%. Comparing base (6fd62b4) to head (967b94e).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 node instead of usage 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>
@jdx
Copy link
Owner

jdx commented Dec 30, 2025

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!

@jdx jdx merged commit 5336290 into jdx:main Dec 30, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants