Skip to content

Enforce common include guard format - #52

Merged
ninotarantino merged 5 commits into
mainfrom
standardize-include-guards
Jul 20, 2026
Merged

Enforce common include guard format#52
ninotarantino merged 5 commits into
mainfrom
standardize-include-guards

Conversation

@ninotarantino

@ninotarantino ninotarantino commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

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_HH
  • models/utilities/fault_management/include/fault_overwrite.hh: CML_FAULT_OVERWRITE_HH
  • models/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

@ninotarantino ninotarantino self-assigned this Jul 17, 2026
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
ninotarantino marked this pull request as ready for review July 17, 2026 16:35
@ninotarantino
ninotarantino requested a review from ddj116 July 17, 2026 17:47
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 85.284%. remained the same — standardize-include-guards into main

@ddj116 ddj116 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@ninotarantino
ninotarantino merged commit 783b489 into main Jul 20, 2026
4 of 5 checks passed
@ninotarantino
ninotarantino deleted the standardize-include-guards branch July 20, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize include guards

3 participants