This skill provides instructions for using tools_webrtc/iwyu/apply-include-cleaner, a tool that automatically manages C++ #include directives in the WebRTC codebase. It ensures that every header used is explicitly included and that unused headers are removed.
#include blocks.To run the include cleaner on specific files:
tools_webrtc/iwyu/apply-include-cleaner path/to/file.cc path/to/file.h
To run it on all modified files relative to the upstream branch (ideal for CL preparation):
tools_webrtc/iwyu/apply-include-cleaner
Note: This is as expensive as a build for each file, so use it sparingly.
-p, --print: Don't modify the files, just print the proposed changes.-w WORK_DIR, --work-dir WORK_DIR: Specify the GN work directory (default: out/Default).After running the include cleaner, it is recommended to perform the following steps to ensure build and style consistency:
tools_webrtc/gn_check_autofix.py to fix any deps issues caused by include changes.tools_webrtc/gn_check_autofix.py -C out/Default
git cl format to fix any formatting issues in the #include blocks.git cl format
compile_commands.json in the output directory if out/Default exists.clangd must be checked out in your .gclient file ("checkout_clangd": True).