Refactor pushws command - #1246
Merged
Merged
Conversation
tompng
reviewed
Sep 7, 2026
|
|
||
| if obj_inspection.size > 20 | ||
| if obj_inspection.size > MAX_WORKSPACE_INSPECT_LENGTH | ||
| obj_inspection = obj_inspection[0, 19] + "...>" |
Member
There was a problem hiding this comment.
MAX_WORKSPACE_INSPECT_LENGTH needs to be used here to calculate 19
tompng
reviewed
Sep 7, 2026
| class Workspaces < Base | ||
| category "Workspace" | ||
| description "Show workspaces." | ||
| MAX_WORKSPACE_INSPECT_LENGTH = 20 |
Member
There was a problem hiding this comment.
Could you also make the constant visibility private to avoid it being used as a public API, or let it just a local variable in this method?
private_constant :MAX_WORKSPACE_INSPECT_LENGTHor
threshold = 20 # because only truncated_inspect use this value
if obj_inspection.size > threshold
...
end
Contributor
Author
There was a problem hiding this comment.
Sure will do it now
Contributor
Author
There was a problem hiding this comment.
@tompng all changes done. Thanks for the review.
GabrielLidenor
force-pushed
the
refactor-pushws-command
branch
from
September 7, 2026 12:47
ca9a732 to
96db46a
Compare
20 does not explain well what we are doing
GabrielLidenor
force-pushed
the
refactor-pushws-command
branch
from
September 7, 2026 12:49
96db46a to
40cbed4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1245
Why
inspection_results20in the workspace truncation logic with a named constant for clarity