Skip to content

fmt: multi-line map formatting#144

Open
sagikazarmark wants to merge 1 commit into
vito:mainfrom
sagikazarmark:map-formatting
Open

fmt: multi-line map formatting#144
sagikazarmark wants to merge 1 commit into
vito:mainfrom
sagikazarmark:map-formatting

Conversation

@sagikazarmark

Copy link
Copy Markdown
Contributor

This PR changes map formatting, so they are formatted the same way as lists.

Signed-off-by: Mark Sagi-Kazar <[email protected]>
@vito

vito commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Thanks! Agree with these rules in general, but I'm getting this diff, which I think is less nice - could we keep an exception for single-list/map-arg so the brackets don't get their own line?

diff --git a/.dagger/main.dang b/.dagger/main.dang
index e3a3a5f0..ad3e2b59 100644
--- a/.dagger/main.dang
+++ b/.dagger/main.dang
@@ -69,14 +69,16 @@ type Dang {
   fmt: Changeset! {
     base
       .withFile("/usr/bin/dang", binary)
-      .withExec([
-        "bash", "-c",
-        """
-        find . -name '*.dang' | while read f; do
-          dang fmt -lw "$f" || echo "skipping unparseable file: $f" >&2
-        done
-        """,
-      ])
+      .withExec(
+        [
+          "bash", "-c",
+          """
+          find . -name '*.dang' | while read f; do
+            dang fmt -lw "$f" || echo "skipping unparseable file: $f" >&2
+          done
+          """,
+        ],
+      )
       .directory(".")
       .changes(base.directory("."))
   }

A dagger generate -y to apply these in the same PR will also fix the check and make these easier to spot in review.

@sagikazarmark

Copy link
Copy Markdown
Contributor Author

Hm, yeah, makes sense, but I used the List code as an example. I'll check if it has this issue as well.

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