commit | aeef0fa759ee4fe8f2a668d666bfa9f0703ec119 | [log] [tgz] |
---|---|---|
author | Dor Hen <dorhen@meta.com> | Tue Apr 15 06:49:44 2025 |
committer | WebRTC LUCI CQ <webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com> | Sun Apr 20 10:32:32 2025 |
tree | a48868d2c85d7649b9eb42a1e43724d79ebafe9b | |
parent | 3d47718f705cbc7ac4c34f38c4acfda92c0d31f2 [diff] |
[iwyu] Python alternative to `apply-include-cleaner` bash script Introducing the python variation to the `apply-include-cleaner` bash script. Bash script was personally very hard to read and follow. Python provides much more pleasant interface for the kind of operations we do like arg parsing, file manipulation and really general maintenance cost. Ideally we would just `git rm` the bash variation but it'd be nice to hold both for a week~, use the python variation, fix any errors on demand and then get rid of the bash script. Tested by: - Compare outputs for the `common_video` dir by running: ``` > find common_video/ -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply_include_cleaner.py > git diff > /tmp/iwyu_py > git restore . > find common_video/ -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner > git diff > /tmp/iwyu_bash > diff /tmp/iwyu_py /tmp/iwyu_bash ``` - To test the "print and fail on output" functionality - execute on `common_video` with `-pf` and make sure exit code is 1 - 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 cleaner attempted to suggest `gtest/gmock` / `gtest/gtest` I'll look into doing this with a single `subprocess.run` invocation instead of for looping on the list of files, but on a separate CL to keep this one kinda straight forward. P.S Comparing the performance of the scripts on `common_video` which included running on 59 files concluded: - Bash script with an average wall time of 29s~ - Python script with an average wall time of 35s~ BUG=webrtc:42226242 Change-Id: I1c13b7567442c952ccdee2b6349215242830e5dc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/384160 Reviewed-by: Jeremy Leconte <jleconte@webrtc.org> Commit-Queue: Dor Hen <dorhen@meta.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#44419}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See here for instructions on how to get started developing with the native code.
Authoritative list of directories that contain the native API header files.