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

Include guards are not consistently named #1023

Closed
confluence opened this issue Feb 16, 2022 · 1 comment · Fixed by #1326
Closed

Include guards are not consistently named #1023

confluence opened this issue Feb 16, 2022 · 1 comment · Fixed by #1326
Assignees
Labels
code maintenance For issues relating to code maintenance and quality
Milestone

Comments

@confluence
Copy link
Collaborator

The #ifndef guards in our headers and template files are inconsistently named -- some still reflect old file names or locations, some never used the same convention in the first place, etc.. It would be simple to extend our style.py script to check and fix these automatically.

Here's a discussion of various possible naming conventions. My suggestion would be something like CARTA_PATH_TO_FILE_H_, which is close to what we have already. Maybe with the top-level directory included, so that we can distinguish between CARTA_SRC... and CARTA_TEST... ?

@confluence confluence added the code maintenance For issues relating to code maintenance and quality label Feb 16, 2022
@confluence confluence self-assigned this Sep 26, 2023
@confluence
Copy link
Collaborator Author

I think a sensible convention would be CARTA_SRC_... for everything in src, and CARTA_TEST_... for everything in test. The BACKEND is redundant and should be removed. After that, the name should follow the path.

Examples:

  • src/HttpServer/HttpServer.h: CARTA_SRC_HTTPSERVER_HTTPSERVER_H_
  • src/Cache/RequirementsCache.h: CARTA_SRC_CACHE_REQUIREMENTSCACHE_H_
  • test/CommonTestUtilities.h: CARTA_TEST_COMMONTESTUTILITIES_H_

It should be possible to do this automatically with a bash script. It's also relatively low-priority (purely cosmetic).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code maintenance For issues relating to code maintenance and quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants