Skip to content
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

Style: Harmonize header guards to style guide [Core] #37290

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

akien-mga
Copy link
Member

Reviewed all core/ headers to ensure that they have header guards that match their file name, and and that the last #endif includes the name of the guard as comment, as in our guidelines: http://docs.godotengine.org/en/latest/community/contributing/code_style_guidelines.html#header-includes

I'll leave the rest of the codebase for another contributor to have a look at, but instead of doing it manually, I would suggest writing a script that we can use periodically to parse and fix the codebase, as we do with misc/scripts/fix_headers.py. Some special cases need to be handled too as those added in #37143 (i.e. guards which don't directly match their file name to avoid duplicates).


To review header guards for all headers:

find -name thirdparty -prune -o -name "*.h" | sort > headers
for file in $(cat headers); do echo -e "\n$file"; grep "#ifndef .*_H" $file; done > output

@akien-mga akien-mga added this to the 4.0 milestone Mar 25, 2020
@akien-mga akien-mga merged commit 35e700e into godotengine:master Mar 25, 2020
@akien-mga akien-mga deleted the style-header-guards-core branch March 25, 2020 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant