Skip to content

Switch profiler-edit from minimist to commander#6065

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-sxtmrtsoupuu
May 28, 2026
Merged

Switch profiler-edit from minimist to commander#6065
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-sxtmrtsoupuu

Conversation

@mstange
Copy link
Copy Markdown
Contributor

@mstange mstange commented May 27, 2026

No description provided.

@mstange mstange requested a review from canova May 27, 2026 20:46
@mstange mstange requested a review from fatadel as a code owner May 27, 2026 20:46
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 59.37500% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.78%. Comparing base (9faa037) to head (08c584a).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/node-tools/profiler-edit.ts 59.37% 13 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6065   +/-   ##
=======================================
  Coverage   83.77%   83.78%           
=======================================
  Files         329      329           
  Lines       34547    34544    -3     
  Branches     9667     9675    +8     
=======================================
- Hits        28943    28941    -2     
+ Misses       5175     5174    -1     
  Partials      429      429           

☔ 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
Copy Markdown
Member

@canova canova left a comment

Choose a reason for hiding this comment

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

Nice!

process.exit(1);
});
} catch (err) {
console.error(err instanceof Error ? err.message : String(err));
Copy link
Copy Markdown
Member

@canova canova May 28, 2026

Choose a reason for hiding this comment

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

Nit: I think due to exitOverride() above, now the errors are being printed twice, one by commander and the second time here.

For example I tested this:

$ node node-tools-dist/profiler-edit.js --asdfsdf
error: unknown option '--asdfsdf'
error: unknown option '--asdfsdf'

Could we maybe add an early return like this?

  if (err instanceof CommanderError) {
      // Commander already wrote its own output and chose the
      // appropriate exit code.
      process.exit(err.exitCode);
    }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, good catch!

@mstange mstange force-pushed the push-sxtmrtsoupuu branch from 275c0a1 to 79e63d3 Compare May 28, 2026 15:39
@mstange mstange force-pushed the push-sxtmrtsoupuu branch from 79e63d3 to 08c584a Compare May 28, 2026 15:39
@mstange mstange enabled auto-merge May 28, 2026 15:41
@mstange mstange merged commit a887d1c into firefox-devtools:main May 28, 2026
21 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