-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checking and verification support for includes using IWYU #23092
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove using-directives namespaces in Tizen platform
1de55c6
to
c086c2b
Compare
PR #23092: Size comparison from 54d8dd0 to c086c2b Increases (9 builds for cc13x2_26x2, efr32, esp32, psoc6, telink)
Decreases (8 builds for bl602, bl702, cc13x2_26x2, psoc6, telink)
Full report (55 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
PR #23092: Size comparison from 54d8dd0 to 7345dc0 Increases (11 builds for bl602, bl702, cc13x2_26x2, efr32, esp32, linux, mbed, telink)
Decreases (8 builds for bl602, bl702, cc13x2_26x2, linux, psoc6, telink)
Full report (55 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
arkq
approved these changes
Nov 22, 2022
PR #23092: Size comparison from eb03243 to 8b29751 Increases (8 builds for bl602, bl702, cc13x2_26x2, cyw30739, esp32, psoc6, telink)
Decreases (5 builds for bl602, cc13x2_26x2, esp32, psoc6, telink)
Full report (55 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
arkq
reviewed
Nov 24, 2022
PR #23092: Size comparison from 733afaa to 5c5f2a8 Increases (6 builds for bl602, bl702, cc13x2_26x2, efr32, esp32, psoc6)
Decreases (5 builds for bl602, bl702, psoc6, telink)
Full report (56 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
PR #23092: Size comparison from 7d786d0 to 136f968 Increases (3 builds for cc13x2_26x2, esp32, psoc6)
Decreases (12 builds for bl602, bl702, cc13x2_26x2, esp32, nrfconnect, psoc6, telink)
Full report (57 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Matter has some problems with includes in source and header files. At the moment, any Matter tools do not check or verify these things. This is the reason for adding a new tool to help developers.
Change overview
The include-what-you-use utility helps the programmer find what includes is needed for the source or header files and show which includes is not being used and more. In this solution, we're adding a new Matter helper script that can check for includes using IWYU. In the future, can run this check in a test workflow and help improve code writing quality and avoid errors.
The script requires compile_commands.json to be scanned, so targets having this JSON can easily scan their files with this tool. The script can also scan multiple compile_comands files in one location. For example, when you build using
./gn_build.sh
created./out/debug
directory and this is default setting for this script. For generate compile_commands file we can use helper./scripts/helpers/update_compile_commands.sh
. Script default scanning files in destination./src/platform
In these changes, we also added IWYU to the installation packages for the chip-build image.
For example, we fixed the includes in the Tizen platform.
./src/platform/Tizen
Testing
For all compile_commands in
./out/debug
use:./scripts/helpers/iwyu_check.py
If some compile_commands.json be empty script can stop.
If you need you can use custom scanning
For specific compile_command file:
./scripts/helpers/iwyu_check.py --compile-commands-glob ./out/debug/compile_commands.clang.json
For specific destination scaning file:
./scripts/helpers/iwyu_check.py --compile-commands-glob ./out/debug/compile_commands.clang.json --scanning-destination ./src/platform/Linux/ConnectivityManagerImpl.cpp