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

[Cleanup] Unify header guards #2936

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Fuzzbawls
Copy link
Collaborator

For a while now, we've been using a mish-mash of various header guard styles, with no real consistency project wide. This PR remedies that by setting a strict header guard notation style.

All first-party headers now follow the below guard style:

#ifndef PIVX_<PATH_TO>_<FILENAME>_H
#define PIVX_<PATH_TO>_<FILENAME>_H
...
#endif // PIVX_<PATH_TO>_<FILENAME>_H

Git subtrees and integrated 3rd party libraries are excluded.

A linter is included so as to prevent future inclusion of include guards that do not adhere to the above standard style.

With this in place, there is more opportunity to "declutter" our file structure quite a bit, especially with regards to the GUI files.

Use standardized include guard naming scheme project wide. Excludes 3rd
party libraries and subtrees.
@Fuzzbawls Fuzzbawls added this to the 6.0.0 milestone Sep 1, 2024
@Fuzzbawls Fuzzbawls self-assigned this Sep 1, 2024
Copy link

@panleone panleone left a comment

Choose a reason for hiding this comment

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

only one small nit:

with the current script we check only that the header guard begins with PIVX_<PATH_TO>_<FILENAME>_H

But something like
PIVX_<PATH_TO>_<FILENAME>_H2323asd

would be accepted too.

I suggested a small change to fix the issue

test/lint/lint-include-guards.sh Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants