)]}'
{
  "commit": "aeef0fa759ee4fe8f2a668d666bfa9f0703ec119",
  "tree": "a48868d2c85d7649b9eb42a1e43724d79ebafe9b",
  "parents": [
    "3d47718f705cbc7ac4c34f38c4acfda92c0d31f2"
  ],
  "author": {
    "name": "Dor Hen",
    "email": "dorhen@meta.com",
    "time": "Tue Apr 15 06:49:44 2025"
  },
  "committer": {
    "name": "WebRTC LUCI CQ",
    "email": "webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Sun Apr 20 10:32:32 2025"
  },
  "message": "[iwyu] Python alternative to `apply-include-cleaner` bash script\n\nIntroducing the python variation to the `apply-include-cleaner` bash\nscript.\nBash script was personally very hard to read and follow.\nPython provides much more pleasant interface for the kind of operations\nwe do like arg parsing, file manipulation and really general\nmaintenance cost.\nIdeally we would just `git rm` the bash variation but it\u0027d be nice to\nhold both for a week~, use the python variation, fix any errors on demand and\nthen get rid of the bash script.\n\nTested by:\n- Compare outputs for the `common_video` dir by running:\n```\n\u003e find common_video/ -name \"*.h\" -o -name \"*.cc\" | xargs tools_webrtc/iwyu/apply_include_cleaner.py\n\u003e git diff \u003e /tmp/iwyu_py\n\u003e git restore .\n\u003e find common_video/ -name \"*.h\" -o -name \"*.cc\" | xargs tools_webrtc/iwyu/apply-include-cleaner\n\u003e git diff \u003e /tmp/iwyu_bash\n\u003e diff /tmp/iwyu_py /tmp/iwyu_bash\n```\n\n- To test the \"print and fail on output\" functionality - execute on `common_video` with `-pf` and make sure\nexit code is 1\n- To test the \"print and fail on output but only if changes are not gtest/gmock/net_helpers\" functionality - execute on `common_video`, commit, execute again but with the `-pf` flags - validate exit code is 0 although\ncleaner attempted to suggest `gtest/gmock` / `gtest/gtest`\n\nI\u0027ll look into doing this with a single `subprocess.run` invocation\ninstead of for looping on the list of files, but on a separate CL\nto keep this one kinda straight forward.\n\n\nP.S Comparing the performance of the scripts on `common_video` which included running on 59 files concluded:\n- Bash script with an average wall time of 29s~\n- Python script with an average wall time of 35s~\n\nBUG\u003dwebrtc:42226242\n\nChange-Id: I1c13b7567442c952ccdee2b6349215242830e5dc\nReviewed-on: https://webrtc-review.googlesource.com/c/src/+/384160\nReviewed-by: Jeremy Leconte \u003cjleconte@webrtc.org\u003e\nCommit-Queue: Dor Hen \u003cdorhen@meta.com\u003e\nReviewed-by: Harald Alvestrand \u003chta@webrtc.org\u003e\nCr-Commit-Position: refs/heads/main@{#44419}\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7f89b85bd2d995f49a1a4e8e25fb6699d1714cdf",
      "new_mode": 33261,
      "new_path": "tools_webrtc/iwyu/apply_include_cleaner.py"
    }
  ]
}
