-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
util: refactor inspecting long lines #28055
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
Conversation
Using the `util.inspect` `compact` mode set to something else than `true` resulted in breaking long lines in case the line would exceed the `breakLength` option and if it contained whitespace and or new lines. It turned out that this behavior was less useful than originally expected and it is now changed to only break on line breaks if the `breakLength` option is exceeded for the inspected string. This should be align better with the user expectation than the former behavior. Fixes: nodejs#27690
benjamingr
left a comment
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.
Code change lgtm, I have no strong feelings about the behavior change.
|
i don't understand well enough what this change does behaviorally or code wise to review it. |
|
@devsnek the behavior changes from:
To:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/23752/ ✅ (yellow build) |
|
Landed in 26de13a 🎉 (The build was yellow and not green but the CI was run very often and all possible CI combinations where green on at least one of those builds) |
Using the `util.inspect` `compact` mode set to something else than `true` resulted in breaking long lines in case the line would exceed the `breakLength` option and if it contained whitespace and or new lines. It turned out that this behavior was less useful than originally expected and it is now changed to only break on line breaks if the `breakLength` option is exceeded for the inspected string. This should be align better with the user expectation than the former behavior. PR-URL: nodejs#28055 Fixes: nodejs#27690 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Using the `util.inspect` `compact` mode set to something else than `true` resulted in breaking long lines in case the line would exceed the `breakLength` option and if it contained whitespace and or new lines. It turned out that this behavior was less useful than originally expected and it is now changed to only break on line breaks if the `breakLength` option is exceeded for the inspected string. This should be align better with the user expectation than the former behavior. PR-URL: #28055 Fixes: #27690 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Notable changes:
This release contains `semver-major` commits. These are in fact not
`semver-major` due to follow-up commits that remove all breaking changes.
* build:
* The startup time is reduced by enabling V8 snapshots by default
#28181
* deps:
* Updated `V8` to 7.5.288.22 #27375
* The numeric separator (v8.dev/features/numeric-separators) feature is now
enabled by default
* Updated `OpenSSL` to 1.1.1c #28211
* inspector:
* The `--inspect-publish-uid` flag was added to specify ways of the inspector
web socket url exposure #27741
* n-api:
* Accessors on napi_define_* are now ECMAScript-compliant
#27851
* report:
* The cpu info got added to the report output
#28188
* src:
* Restore the original state of the stdio file descriptors on exit to prevent
leaving stdio in raw or non-blocking mode
#24260
* tools,gyp:
* Introduce MSVS 2019 #27375
* util:
* inspect:
* Array grouping became more compact and uses more columns than before
#28059
#28070
* Long strings will not be split at 80 characters anymore. Instead they will
be split on new lines #28055
* worker:
* `worker.terminate()` now returns a promise and using the callback is
deprecated #28021
PR-URL: #28268
Notable changes:
* build:
* The startup time is reduced by enabling V8 snapshots by default
#28181
* deps:
* Updated `V8` to 7.5.288.22 #27375
* The numeric separator (v8.dev/features/numeric-separators) feature is now
enabled by default
* Updated `OpenSSL` to 1.1.1c #28211
* inspector:
* The `--inspect-publish-uid` flag was added to specify ways of the inspector
web socket url exposure #27741
* n-api:
* Accessors on napi_define_* are now ECMAScript-compliant
#27851
* report:
* The cpu info got added to the report output
#28188
* src:
* Restore the original state of the stdio file descriptors on exit to prevent
leaving stdio in raw or non-blocking mode
#24260
* tools,gyp:
* Introduce MSVS 2019 #27375
* util:
* inspect:
* Array grouping became more compact and uses more columns than before
#28059
#28070
* Long strings will not be split at 80 characters anymore. Instead they will
be split on new lines #28055
* worker:
* `worker.terminate()` now returns a promise and using the callback is
deprecated #28021
PR-URL: #28268
Notable changes:
* build:
* The startup time is reduced by enabling V8 snapshots by default
#28181
* deps:
* Updated `V8` to 7.5.288.22 #27375
* The numeric separator (v8.dev/features/numeric-separators) feature is now
enabled by default
* Updated `OpenSSL` to 1.1.1c #28211
* inspector:
* The `--inspect-publish-uid` flag was added to specify ways of the inspector
web socket url exposure #27741
* n-api:
* Accessors on napi_define_* are now ECMAScript-compliant
#27851
* report:
* The cpu info got added to the report output
#28188
* src:
* Restore the original state of the stdio file descriptors on exit to prevent
leaving stdio in raw or non-blocking mode
#24260
* tools,gyp:
* Introduce MSVS 2019 #27375
* util:
* inspect:
* Array grouping became more compact and uses more columns than before
#28059
#28070
* Long strings will not be split at 80 characters anymore. Instead they will
be split on new lines #28055
* worker:
* `worker.terminate()` now returns a promise and using the callback is
deprecated #28021
PR-URL: #28268
Notable changes:
* build:
* The startup time is reduced by enabling V8 snapshots by default
#28181
* deps:
* Updated `V8` to 7.5.288.22 #27375
* The numeric separator (v8.dev/features/numeric-separators) feature is now
enabled by default
* Updated `OpenSSL` to 1.1.1c #28211
* inspector:
* The `--inspect-publish-uid` flag was added to specify ways of the inspector
web socket url exposure #27741
* n-api:
* Accessors on napi_define_* are now ECMAScript-compliant
#27851
* report:
* The cpu info got added to the report output
#28188
* src:
* Restore the original state of the stdio file descriptors on exit to prevent
leaving stdio in raw or non-blocking mode
#24260
* tools,gyp:
* Introduce MSVS 2019 #27375
* util:
* inspect:
* Array grouping became more compact and uses more columns than before
#28059
#28070
* Long strings will not be split at 80 characters anymore. Instead they will
be split on new lines #28055
* worker:
* `worker.terminate()` now returns a promise and using the callback is
deprecated #28021
PR-URL: #28268
Notable changes:
* build:
* The startup time is reduced by enabling V8 snapshots by default
nodejs#28181
* deps:
* Updated `V8` to 7.5.288.22 nodejs#27375
* The numeric separator (v8.dev/features/numeric-separators) feature is now
enabled by default
* Updated `OpenSSL` to 1.1.1c nodejs#28211
* inspector:
* The `--inspect-publish-uid` flag was added to specify ways of the inspector
web socket url exposure nodejs#27741
* n-api:
* Accessors on napi_define_* are now ECMAScript-compliant
nodejs#27851
* report:
* The cpu info got added to the report output
nodejs#28188
* src:
* Restore the original state of the stdio file descriptors on exit to prevent
leaving stdio in raw or non-blocking mode
nodejs#24260
* tools,gyp:
* Introduce MSVS 2019 nodejs#27375
* util:
* inspect:
* Array grouping became more compact and uses more columns than before
nodejs#28059
nodejs#28070
* Long strings will not be split at 80 characters anymore. Instead they will
be split on new lines nodejs#28055
* worker:
* `worker.terminate()` now returns a promise and using the callback is
deprecated nodejs#28021
PR-URL: nodejs#28268
Using the
util.inspectcompactmode set to something else thantrueresulted in breaking long lines in case the line would exceedthe
breakLengthoption and if it contained whitespace and or newlines.
It turned out that this behavior was less useful than originally
expected and it is now changed to only break on line breaks if the
breakLengthoption is exceeded for the inspected string. This shouldbe align better with the user expectation than the former behavior.
Fixes: #27690
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes