)]}'
{
  "commit": "71ddd076810dfbf7a22c67d98c250bd26a431dfb",
  "tree": "75e4a125d005d1a321289fd6b5c297da845ad879",
  "parents": [
    "52d84d6a2acdea629360e30e8d43943041a4ca36"
  ],
  "author": {
    "name": "Camille Simon",
    "email": "43054281+camsim99@users.noreply.github.com",
    "time": "Wed Jul 08 09:34:21 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jul 08 16:34:21 2026 +0000"
  },
  "message": "Add pre-commit hook to verify static analysis passes \u0026 format is correct (#11941)\n\nAdds a pre-commit hook that you can install to verify that `dart analyze --fatal-infos` and the package format are correct when you make a call to `git commit`. Intended to ensure agents commit code that meets are quality standards.\r\n\r\nAlso makes the following updates the plugins tool:\r\n\r\n- Adds `--run-on-staged-packages` flag that allows the command to only run on files with staged changes. This flag cannot be run with any other flags that filter packages where the command runs (like `--run-on-dirty-packages`)\r\n- Adds optimization to the format tool to avoid invoking native tool chains to format when non-native files are modified\r\n\r\nMiscellaneous notes:\r\n\r\n- `script/githooks/bin/install_hooks.dart` is the script to install the hook that devs would need to run to use it.\r\n- I modeled the new `githooks` directory like https://github.com/flutter/flutter/tree/master/engine/src/flutter/tools/githooks to make it easier for folks to add new hooks\r\n\r\n## Pre-Review Checklist\r\n\r\n**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member\u0027s review for guidance on which automated comments should be addressed.\r\n\r\n[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8323cbfaa17ecf18a7d173a0c02e91abc72f3f49",
      "new_mode": 33188,
      "new_path": "script/githooks/README.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b2c8abdb425ad8cfc124306f40be6bc66bd97fff",
      "new_mode": 33188,
      "new_path": "script/githooks/bin/install_hooks.dart"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7a76444ea864792c0f87db55300ca0e1ec70458c",
      "new_mode": 33188,
      "new_path": "script/githooks/bin/main.dart"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d8f6fc81d9ac11da8dabce0eb836e79bb2b1def9",
      "new_mode": 33188,
      "new_path": "script/githooks/lib/githooks.dart"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "73d7819fba44ec9b2c6ee73d7d410d7a2d757f58",
      "new_mode": 33188,
      "new_path": "script/githooks/lib/src/pre_commit_command.dart"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "809f62c219dffa289399f41448c4a76cafa34f5f",
      "new_mode": 33261,
      "new_path": "script/githooks/pre-commit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "71a0e69c1d429354c6273d83b3279c2ce8d267eb",
      "new_mode": 33188,
      "new_path": "script/githooks/pubspec.yaml"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0f8c9e2ca79e7212736ce7ba3336e7496eef1d96",
      "new_mode": 33188,
      "new_path": "script/githooks/test/pre_commit_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "98e73d3e36fe56b7f845904a5e61819d6130b557",
      "old_mode": 33188,
      "old_path": "script/tool/CHANGELOG.md",
      "new_id": "681030c447c12eee246a284a28792c824f634d8a",
      "new_mode": 33188,
      "new_path": "script/tool/CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "c033e255729d6ae276e4b26ef42a42a5aa1c7fdd",
      "old_mode": 33188,
      "old_path": "script/tool/lib/src/common/git_version_finder.dart",
      "new_id": "07a91c1eb806498ac3e3d45b9ec1b848d3beecfd",
      "new_mode": 33188,
      "new_path": "script/tool/lib/src/common/git_version_finder.dart"
    },
    {
      "type": "modify",
      "old_id": "8d0fbb59143697d9c31b10457bb2e87a9dd34b60",
      "old_mode": 33188,
      "old_path": "script/tool/lib/src/common/package_command.dart",
      "new_id": "76546964b96215396d22717ea79b70fececa9b0d",
      "new_mode": 33188,
      "new_path": "script/tool/lib/src/common/package_command.dart"
    },
    {
      "type": "modify",
      "old_id": "96d71605d84c3ab0d1d3129d14a5e22260ae900c",
      "old_mode": 33188,
      "old_path": "script/tool/lib/src/common/package_looping_command.dart",
      "new_id": "0d7f528da23f8a9c2088184ef16819cd01d491f4",
      "new_mode": 33188,
      "new_path": "script/tool/lib/src/common/package_looping_command.dart"
    },
    {
      "type": "modify",
      "old_id": "2e25c93b8f39ac836e3dae20da8135369329be5c",
      "old_mode": 33188,
      "old_path": "script/tool/lib/src/format_command.dart",
      "new_id": "d0d32649a618240be90de5c8816d668241e58589",
      "new_mode": 33188,
      "new_path": "script/tool/lib/src/format_command.dart"
    },
    {
      "type": "modify",
      "old_id": "22db73abf0986e436255ba4c913209a0d41746fe",
      "old_mode": 33188,
      "old_path": "script/tool/pubspec.yaml",
      "new_id": "957b1ebe343d997fac59c8073bf319c9190121f6",
      "new_mode": 33188,
      "new_path": "script/tool/pubspec.yaml"
    },
    {
      "type": "modify",
      "old_id": "9ac9dd2f47596375077ef9ffefec7f183aca241a",
      "old_mode": 33188,
      "old_path": "script/tool/test/common/git_version_finder_test.dart",
      "new_id": "8ea776ceae400bcdf3117b40af9cd02c85a349a7",
      "new_mode": 33188,
      "new_path": "script/tool/test/common/git_version_finder_test.dart"
    },
    {
      "type": "modify",
      "old_id": "abe197a9be317ccc6981dec97b7a120310fb62c6",
      "old_mode": 33188,
      "old_path": "script/tool/test/common/package_command_test.dart",
      "new_id": "2aa109f050aa7b21f29843a428fc29dc81bd9b15",
      "new_mode": 33188,
      "new_path": "script/tool/test/common/package_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "f57e0f0c734f150811426c41df3f71d9d8d8c048",
      "old_mode": 33188,
      "old_path": "script/tool/test/federation_safety_check_command_test.dart",
      "new_id": "c10fb9609146db362eb1ecc3e99bafaa14537ec8",
      "new_mode": 33188,
      "new_path": "script/tool/test/federation_safety_check_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "18647d28d78357a783772b4987e36d77d044b54c",
      "old_mode": 33188,
      "old_path": "script/tool/test/format_command_test.dart",
      "new_id": "db0ec3141a628d47e7bb814639c024e38df0a9e8",
      "new_mode": 33188,
      "new_path": "script/tool/test/format_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "07024da5f4d275760d2db9b36d7ec455cb334681",
      "old_mode": 33188,
      "old_path": "script/tool/test/mocks.dart",
      "new_id": "e9af89f5cfd08cae12a74167e6c30c54e572bbab",
      "new_mode": 33188,
      "new_path": "script/tool/test/mocks.dart"
    }
  ]
}
