-
Notifications
You must be signed in to change notification settings - Fork 2.1k
tracking: fixing order of doxygen tags and header guards #21335
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
Comments
The order should also be fixed in https://github.com/aabadie/riot-generator |
I wonder if your Python script could be adapted and added to the static tests, so that for future contributions, the include guards are checked as well before merging 🤔 |
This seem like a very reasonable addition. I have yet to look into CI stuff as I have never worked with it. |
There is some documentation in the You don't necessarily have to look into CI for that, the script is executed when you call |
This patch updates the example given to conform to the recomended placement of include guards. See issue RIOT-OS#21335
This patch updates the example given to conform to the recomended placement of include guards. See issue RIOT-OS#21335
Should we just move to |
@benpicco Yes!! |
That would be fine by me. |
We had that discussion at VMA 2024.11 and had general consensus on switching to |
Awesome! I have updated #21344 to make use of the |
Hello, I am new to the RIOT community and would like to help fix the headers. I can start in the |
This patch updates the example given to conform to the recomended placement of include guards. See issue RIOT-OS#21335
Description
Clang-format requires the header guard #ifndef #define HEADER_GUARD_H to be outside of the doxygen documentation, that means outside the @{ ... @} block. If this is not done, then clang-format will indent all preprocessor directives after the #ifndef.
The problem is that the majority of RIOT's header files don't adhere to this order. They either have the header guard inside the doxygen block or the header guard starts correctly outside the doxygen block but the #endif directive is still inside the doxygen documentation.
To fix this inconsistency, I have written a python script that recursively scans all header files in a directory and rearranges the parts, so that the correct order is established.
Fixed directories
Testing procedure
Use my python script and change the path variable 'RIOT_PATH' in the script to whatever directory you want to recursively fix the header files.
Warning: the script isn't fool-proof but fixes 95% of all header files that have this issue. There are individual issues with the formatting that require manual intervention.
The script can be found here
Application
This is based on the fix in #20905 addressed by @mguetschow but with the added benefit of keeping the blocks balanced.
The text was updated successfully, but these errors were encountered: