-
Notifications
You must be signed in to change notification settings - Fork 343
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: Wrap web-ext usage output at terminal width #2329
Conversation
d5d5230
to
5c352ca
Compare
Codecov Report
@@ Coverage Diff @@
## master #2329 +/- ##
=======================================
Coverage 99.88% 99.88%
=======================================
Files 32 32
Lines 1699 1700 +1
=======================================
+ Hits 1697 1698 +1
Misses 2 2
Continue to review full report at Codecov.
|
Could you add a unit test, so that this feature works as expected even if Yargs changes? |
5c352ca
to
8932364
Compare
@Rob--W: npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - executable path is "/usr/bin/python3"
npm ERR! gyp ERR! find Python - version is "3.5.3"
npm ERR! gyp ERR! find Python - version is 3.5.3 - should be >=3.6.0
npm ERR! gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED Windows requires additional tooling. |
Thanks for the test. Is it possible to just stub some (core) methods to get some minimal coverage? If not then I'm fine to land without tests. |
@Rob--W: simple stubbing didn't help; suspect that |
- The test for `yargs` output width requires an emulated terminal. - The pseudoterminal `node-pty` works, but requires Python >= v3.6.0. - The build system has Python v3.5.3, so removing the tests. - Can be reverted when the build system upgrades Python. See - mozilla#2329 - https://app.circleci.com/pipelines/github/mozilla/web-ext/1034/workflows/6522f202-759a-4d89-9f33-fdef054ad3ae/jobs/4181?invite=true#step-104-26 - https://github.com/microsoft/node-pty
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.
Thanks.
- Detects the terminal width (in characters) using `yargs.terminalWidth()`. - Sets the generated `yargs` usage to wrap at the terminal width instead of at the default (maximum) 80 characters. - Should improve `web-ext` readability by utilizing the full terminal window, when it is greater than 80 characters wide. - In particular, `--help` output is improved. - Testing would require a TTY emulator. Tests were added and removed in mozilla#2329 due to build system tooling issues. See - https://yargs.js.org/docs/#api-reference-wrapcolumns - mozilla#2329
5e85d22
to
e0bd9d5
Compare
- Detects the terminal width (in characters) using `yargs.terminalWidth()`. - Sets the generated `yargs` usage to wrap at the terminal width instead of at the default (maximum) 80 characters. - Should improve `web-ext` readability by utilizing the full terminal window, when it is greater than 80 characters wide. - In particular, `--help` output is improved. - Testing would require a TTY emulator. Tests were added and removed in mozilla#2329 due to build system tooling issues. See - https://yargs.js.org/docs/#api-reference-wrapcolumns - mozilla#2329
e0bd9d5
to
0c5e0e5
Compare
yargs.terminalWidth()
.yargs
usage to wrap at the terminal width instead of at the default (maximum) 80 characters.web-ext
readability by utilizing the full terminal window, when it is greater than 80 characters wide.--help
output is improved.See
Before: (maximum) 80 characters wide
After: 120 characters wide (example, autodetected)