Skip to content
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

Collapse empty call expressions #1308

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

snady
Copy link

@snady snady commented Nov 18, 2024

Use compact mode for call expressions if there are no parameters or line comments.

Running buildifier on

func(
)

doesn't format it because of ForceMultiline, but one could reasonably expect it to collapse into

func()

This comes up sometimes when removing attrs with buildozer -- if ForceMultiline=true but the rule/macro no longer has any attrs, the result will look like the first example e.g

some_macro(
  attr_to_remove=[
    ...
  ]
)
some_macro(
)

@snady snady force-pushed the collapse_empty branch 2 times, most recently from 73bc760 to b1e7215 Compare November 19, 2024 01:18
@snady snady marked this pull request as ready for review November 19, 2024 01:23
Copy link
Member

@vladmos vladmos left a comment

Choose a reason for hiding this comment

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

Thanks!

@vladmos
Copy link
Member

vladmos commented Jan 14, 2025

Hi, please resolve the conflicts, I'll merge the PR

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