)]}'
{
  "commit": "c0e6243c33a1b9b4afbf9160ee3670a3387f0314",
  "tree": "1c50d323c5137d550a04d88b587790074eef65df",
  "parents": [
    "bd2e5c73c94673991aa5a34090337c92e650197d"
  ],
  "author": {
    "name": "David Torosyan",
    "email": "dtoro@fb.com",
    "time": "Thu May 26 11:34:20 2022 -0700"
  },
  "committer": {
    "name": "Facebook GitHub Bot",
    "email": "facebook-github-bot@users.noreply.github.com",
    "time": "Thu May 26 11:34:20 2022 -0700"
  },
  "message": "Add line breaks to lambdas after broken function arguments\n\nSummary:\nWe\u0027ve had some requests to format this:\n\n```\nfoo.bar(\n  trailingComma,\n) { x \u003d 0 }\n```\n\nAs this:\n```\nfoo.bar(\n  trailingComma,\n) {\n  x \u003d 0\n}\n```\n\nHere I do that by keeping track of when we enter lambda arguments in call elements and noting if there\u0027s a trailing comma.\n\n## Caveat\n\n**Google-style requires a trailing comma**\n\nThe Google-style formatting puts the closing paren on the next line, even when there\u0027s no trailing comma. Due to this we can\u0027t detect that we need to put a break in the lambda.\n\nThis could be fixed by detecting if the params broke (instead of looking for a trailing comma) but I\u0027m not sure how to do that.\n\nReviewed By: strulovich\n\nDifferential Revision: D36649191\n\nfbshipit-source-id: 2c8d316f068c1030437af59b5114ffae9d5d2aa8\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1a0136a52499b42ed9906faa8c95265c07675dae",
      "old_mode": 33188,
      "old_path": "core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt",
      "new_id": "cfa58c38f2ff7b5b3924ee5775d26460b642173f",
      "new_mode": 33188,
      "new_path": "core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt"
    },
    {
      "type": "modify",
      "old_id": "b115fc029da75e382f3bd1893b2d9d63be237c18",
      "old_mode": 33188,
      "old_path": "core/src/test/java/com/facebook/ktfmt/format/FormatterTest.kt",
      "new_id": "5c448fb8c67818c2a92888f0541a52027c53a5b3",
      "new_mode": 33188,
      "new_path": "core/src/test/java/com/facebook/ktfmt/format/FormatterTest.kt"
    },
    {
      "type": "modify",
      "old_id": "0e958795b3d6a2bf3533d27c3073fe9dd1a9bcd0",
      "old_mode": 33188,
      "old_path": "core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt",
      "new_id": "a50e7826033f60140b8d5281117f5d8236798f26",
      "new_mode": 33188,
      "new_path": "core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt"
    }
  ]
}
