)]}'
{
  "commit": "43110adf2a8ca77005298d68215c99e2374f26b8",
  "tree": "fdefbbc3ca9329999b67f0e711f36bba67b8a47b",
  "parents": [
    "5cf17f77d6fa8466a1c0db80d12eb8fec9d55709"
  ],
  "author": {
    "name": "Jonas Finnemann Jensen",
    "email": "jonasfj@google.com",
    "time": "Thu May 02 15:42:46 2024 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu May 02 15:42:46 2024 +0200"
  },
  "message": "Fix 55 (dart-lang/yaml_edit#75)\n\nFix removal of last key from map in block-mode when value is empty.\r\n\r\nFixes dart-lang/yaml_edit#55.\r\n\r\nWhen the value is empty the `SourceSpan` for the `YamlNode` representing\r\nthe value in a map points to the colon.\r\n\r\nExample:\r\n```yaml\r\nfoo:\r\n  bar:\r\n```\r\n\r\nThe `YamlNode` for `foo.bar` has a value of `null` and starts and ends\r\nat the colon `:` following `bar`. This means that removal might leave\r\nthe colon behind, which causes invalid YAML.\r\n\r\nWe have the same issue when removing `foo.bar` from the following YAML\r\ndocument:\r\n\r\n```yaml\r\nfoo:\r\n  baz: true\r\n  bar:\r\n```\r\n\r\nHowever, in this case, we have a hack that ensures we always strip away\r\nthe any comments that follows `bar`. We do this by deleting up-to the\r\nnext newline. If we apply the same hack when removing `foo.bar` in the\r\nfirst example, then it works.\r\n\r\nOne could argue that it works by accident, but it\u0027s kind of desired that\r\ntrailing comments are removed, when the value they are trailing is\r\nremoved.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9472abf758d30cef36415b6e3befe7c150d963c7",
      "old_mode": 33188,
      "old_path": "pkgs/yaml_edit/CHANGELOG.md",
      "new_id": "422afe1012212a6d2c82d0ccd2938f940f149468",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "321987fc9d62b60ef43a270117fd946a3c08be47",
      "old_mode": 33188,
      "old_path": "pkgs/yaml_edit/lib/src/map_mutations.dart",
      "new_id": "07a2c549652adbf72697e4e8995d124802c2c0ce",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/lib/src/map_mutations.dart"
    },
    {
      "type": "modify",
      "old_id": "272da404c4ab577026e5b1d8210283a5a7047749",
      "old_mode": 33188,
      "old_path": "pkgs/yaml_edit/pubspec.yaml",
      "new_id": "e9b16549d978cb260cb05e368e13d92f3a6631e2",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/pubspec.yaml"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ff1ac907ce9cd80a61693cb9c22bea4dc33957f5",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/input/issue_55.test"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b28818c4e7bff223c35cde223ca838d3ae29a33e",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/input/remove_key.test"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ce6755172d0cb1b870ce09800fb16b290ab713a9",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/input/remove_key_with_trailing_comma.test"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "201caca7e379acea9e2dcf4d007f1035283053d0",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/input/remove_nested_key.test"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2a6655960961337c402f18b42bef0f1ad0c935a8",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/input/remove_nested_key_with_null.test"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "35ad665340ff86290dcf9c676aa6d098bddd9173",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/input/remove_nested_key_with_trailing_comma.test"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f752a14380d80bc6096c8b12d1ab4f1509e0f701",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/output/issue_55.golden"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "48b86403e3af84d06d8ab5302fc26867bd0ca825",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/output/remove_key.golden"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d85be35379781e04d7a6f630f8ce0dc3499233cc",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/output/remove_key_with_trailing_comma.golden"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "011f1c1cf2a379ac92cbab800d9fbfec2a68ec83",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/output/remove_nested_key.golden"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b0e771cddecdd175307f3f46d4f394c7857c63ee",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/output/remove_nested_key_with_null.golden"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c93c46a97c46829f54dd09066933e1cff528004e",
      "new_mode": 33188,
      "new_path": "pkgs/yaml_edit/test/testdata/output/remove_nested_key_with_trailing_comma.golden"
    }
  ]
}
