-
Notifications
You must be signed in to change notification settings - Fork 53
Remove extra spaces inside parentheses #67
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi Josh, thanks for opening a dedicated issue for this! As mentioned in #20, my idea would be to create a new cleanup rule "Align components in tabular layout" (or similar), which would align cases such as … DATA(var) = VALUE some_type( ( amount = '1.23' name = 'short' )
( amount = '123.4' name = 'longer' )
( amount = '1234.56' name = 'very long' ) ). … into … DATA(var) = VALUE some_type( ( amount = '1.23' name = 'short' )
( amount = '123.4' name = 'longer' )
( amount = '1234.56' name = 'very long' ) ). … providing options on
This would then also cover your example (even if the closing parenthesis would, admittedly, not be the focus of the rule). The options would also benefit cases with just one field if there are multiple rows, so you'd get: DATA(var) = VALUE some_type( ( amount = '1.23' )
( amount = '123.4' )
( amount = '1234.56' ) ). or alternatively: DATA(var) = VALUE some_type( ( amount = '1.23' )
( amount = '123.4' )
( amount = '1234.56' ) ). Kind regards, |
@jmgrassau I was about to create an enhancement request (issue) when I saw your suggestion of component alignment in one line, e.g. doing this automatically: I guess it would be better for follow-up to have a new request created for this request, because I found it only because it was out of curiosity. May I create one if you don't mind? |
This was initially mentioned in #20.
Within parentheses, there is a rule to remove extra spaces for empty parentheses, but the problem exists when there are parameters as well. Perhaps these should both be handled and rename the rule to
Removes multiple spaces from inside parentheses
?Before
After
There was some discussion about possibly keeping some spaces in a tabular layout (I don't have much opinion on that since I don't have an example when I'd ever want to do that), but I think this could be applied in a straightforward way when there is only one field.
The text was updated successfully, but these errors were encountered: