Enforce common include guard format - #52
Merged
Merged
Conversation
Also account for case-insensitivity since our include guards use all-caps, so a case-insensitive match would result in duplicate include guards in the project.
ninotarantino
marked this pull request as ready for review
July 17, 2026 16:35
Collaborator
This file contains hidden or 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
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.
Convert all include guards to the format
CML_<UPPERCASE_FILE_BASENAME>_<FILE_EXTENSION>.Examples:
models/dynamics/integration/accumulated_absolute_deltas/include/accumulated_absolute_deltas.hh:CML_ACCUMULATED_ABSOLUTE_DELTAS_HHmodels/utilities/fault_management/include/fault_overwrite.hh:CML_FAULT_OVERWRITE_HHmodels/utilities/fault_arch/include/sSensorFaults.hh:CML_SSENSORFAULTS_HH(NOTE: this file violates our naming convention anyways and will be fixed in Standardize file naming conventions #40).Added a new static analysis action which throws a failure if any C or C++ file is either missing an include guard or has an improperly formatted include guard. The first commit in this branch shows what that looks like.
Added an additional check to make sure all header file basenames are unique when case-insensitive. Since our include guards only include the all-caps basename in them, all header files need to have unique, case-insensitive names to avoid duplicated include guards.
Closes #47